Usage

This plugin is used to create a Changes Report, a JIRA Report and an Announcement text file. It is also able to send the announcement via email.

How to Generate the Changes Report

In order to use this goal, simply create a changes.xml file in the src/changes/ directory. Here's an example of a typical changes.xml , showing the syntax:

<document>
  <properties>
    <title>Changes Tester Project</title>
    <author email="jruiz@exist.com">Johnny R. Ruiz III</author>
  </properties>
  <body>
    <release version="1.1" date="2005-03-01" description="Subsequent release">
      <action dev="jruiz" type="add">
        Added additional documentation on how to configure the plugin.
      </action>
      <action dev="aramirez" type="fix" issue="MPJIRA-11">
        Enable retrieving component-specific issues.
      </action>
      <action dev="jruiz" type="remove" due-to="Allan Ramirez" due-to-email="aramirez@exist.com">
        The element type " link " must be terminated by the matching end-tag.
        Deleted the erroneous code.
      </action>
    </release>

    <release version="1.0" date="2005-01-01" description="First release">
      <action dev="jruiz" type="update">
        Uploaded documentation on how to use the plugin.
      </action>
    </release>
  </body>
</document>

See the Changes Reference for details regarding the <release> and <action> elements and their attributes.

To generate the Changes Report, insert the Changes Plugin in the <reporting> section of your project's pom.xml

<project>
  ...
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changes-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>changes-report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
  ...
</project>

and execute the site goal to generate the report.

mvn site

Linking to Your Issue Management System

If you use the issue attribute in your changes.xml file and have the <issueManagement> element configured in your pom.xml , the report will contain links to the issues in your issue management system. The default configuration produces links to JIRA, but that can be configured .

Note: If you have another issue tracker, make sure that your <issueManagement>/<url> is correct. In particular, make sure that it has a trailing slash if it needs one. The plugin can't add this for you, because it needs to handle different issue management systems. If your issue management system is at http://www.company.com/bugzilla/ the links will not work if you enter http://www.company.com/bugzilla in your pom.xml .

How to Generate the JIRA Report

Note: To use the JIRA Report, the <issueManagement> section in the pom.xml of your project must be configured. It might look something like this:

<project>
  ...
  <issueManagement>
    <system>JIRA</system>
    <url>http://jira.codehaus.org/BrowseProject.jspa?id=10450</url>
  </issueManagement>
  ...
</project>

To generate the JIRA Report, insert the Changes Plugin in the <reporting> section of your project's pom.xml

<project>
  ...
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changes-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>jira-report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
  ...
</project>

and execute the site goal to generate the report.

mvn site

For info on how to modify the JIRA Report see the Customizing the JIRA Report example.

How to generate and send the Announcement via Email

As usual we start by configuring your project's pom.xml . We add a basic configuration for sending emails and specify the lucky recipients of the announcement emails.

For info on how to change the sender of the email see the Specifying the mail sender example.

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changes-plugin</artifactId>
        <configuration>
          ...
          <smtpHost>mail.yourhost.com</smtpHost>
          <smtpPort implementation="java.lang.Integer">25</smtpPort>
          <toAddresses>
            <toAddress implementation="java.lang.String">someones@email.com</toAddress>
            <toAddress implementation="java.lang.String">anothersomeone@email.com</toAddress>
          </toAddresses>
          ...
        </configuration>
      </plugin>
    </plugins>
  </build>
  ...
</project>

You can now generate the announcement by executing the command below:

mvn changes:announcement-generate

If you want to generate the announcement based on JIRA you would either configure it in your pom.xml or you would add the appropriate parameter on the command line, like this:

mvn changes:announcement-generate -DgenerateJiraAnnouncement=true

This is how you send an email with the generated announcement:

mvn changes:announcement-mail