[ 
http://jira.codehaus.org/browse/MCHANGES-188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=201297#action_201297
 ] 

Dennis Lundberg commented on MCHANGES-188:
------------------------------------------

Sebastian,

You misunderstood me again.

The following section does *not* set the version of maven-changes-plugin. It 
tells maven-changes-plugin that you want to fetch issues for version 2.0 of 
your own artifact from your project's JIRA.

{code:xml}
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-changes-plugin</artifactId>
  <configuration>
    <version>2.0</version>
  </configuration>
</plugin>
{code}

The following section has *no* meaning at all with regards to 
maven-changes-plugin.

{code:xml}
<properties>
  <changes.version>2.0</changes.version>
</properties>
{code}

In the following section, you should not use changes.version, but the actual 
version of maven-changes-plugin that you want to use. I'd recommend the 2.2 
version.

{code:xml}
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-changes-plugin</artifactId>
  <version>{${changes.version}}</version>
  <configuration>
    <onlyCurrentVersion>true</onlyCurrentVersion>
  </configuration>
  <reportSets>
    <reportSet>
      <reports>
        <report>jira-report</report>
      </reports>
    </reportSet>
  </reportSets>
</plugin>
{code}

Now, the correct way to configure this is:

{code:xml}
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-changes-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <onlyCurrentVersion>true</onlyCurrentVersion>
  </configuration>
  <reportSets>
    <reportSet>
      <reports>
        <report>jira-report</report>
      </reports>
    </reportSet>
  </reportSets>
</plugin>
{code}

The plugin will pick up the version of *your* artifact from the 
<project>/<version> element of your artifacts POM. This is the default behavior 
and does not normally need to be changed.

If you want to change the version that you are releasing, and I don't think 
that you need to, you can do this in two ways. Either you add a 
<configuration>/<version> element to the plugin configuration in your POM, 
thereby telling maven-changes-plugin that you want to fetch issue for that 
particular version from JIRA. Or you can add a command line parameter when you 
invoke Maven, like this if you want to fetch issues for version 4.6 from JIRA:

{code}
mvn changes:announcement-generate -Dchanges.version=4.6
{code}


> Announcement collides with ${changes.version} property
> ------------------------------------------------------
>
>                 Key: MCHANGES-188
>                 URL: http://jira.codehaus.org/browse/MCHANGES-188
>             Project: Maven 2.x Changes Plugin
>          Issue Type: Bug
>          Components: announcement
>    Affects Versions: 2.2
>            Reporter: Sebastian Hoß
>
> When you set the ${changes.version} property manually (e.g. to specify the 
> version of the changes plugin itself) the changes-plugin uses the given value 
> as the projects version and fails if you don't have a matching release with 
> the exact same version number.
> This behavior is AFAIK not documented anywhere and should either be changed 
> or documented. I stumbled upon this yesterday and wrote an mail with further 
> information and a stack trace for this here: 
> http://maven.markmail.org/message/mg2qfnd4lw53larn
> The plugins documentation[1] itself says that ${project.version} is the 
> default value for the version field, however the code[2] tells that version 
> is set to the expression="${changes.version}" with a 
> default-value="${project.version}". So this "bug" only affects people who 
> have defined a ${changes.version} property. Changing the name of the property 
> resolves this.
> This only affects the announcement goals, jira-report along mvn site runs 
> fine which may be a little confusing for users who have a running mvn site 
> configuration and now want to add announcement mails but run into this 
> problem (like myself in this case).
> [1]: 
> http://maven.apache.org/plugins/maven-changes-plugin/announcement-generate-mojo.html
> [2]: 
> http://maven.apache.org/plugins/maven-changes-plugin/xref/org/apache/maven/plugin/announcement/AnnouncementMojo.html#82

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to