[ 
https://jira.codehaus.org/browse/MVERSIONS-176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=290808#comment-290808
 ] 

Pete Cornish commented on MVERSIONS-176:
----------------------------------------

h3. Additional info
The patch was built against 
https://svn.codehaus.org/mojo/trunk/mojo/versions-maven-plugin at r15873.

h3. Example
{code:xml}
<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>2.0-SNAPSHOT</version>
        <executions>
                <execution>
                        <id>update-pom-versions</id>
                        <goals>
                                <goal>set</goal>
                                <goal>commit</goal>
                        </goals>
                        <configuration>
                                
<autoIncrementVersion>true</autoIncrementVersion>
                        </configuration>
                </execution>
        </executions>
</plugin>
{code}

Notice the all-important <autoIncrementVersion>true</autoIncrementVersion> 
configuration setting.

The plugin's set task can be invoked without passing a {{-DnewVersion=1.0.2}} 
parameter.

{noformat}
mvn versions:set
{noformat}
                
> Auto-increment POM versions in the 'set' goal
> ---------------------------------------------
>
>                 Key: MVERSIONS-176
>                 URL: https://jira.codehaus.org/browse/MVERSIONS-176
>             Project: Maven 2.x Versions Plugin
>          Issue Type: Improvement
>            Reporter: Pete Cornish
>            Priority: Minor
>         Attachments: autoincrement-versions-maven-plugin-patch.txt
>
>
> h3. Summary
> The 'set' goal can automatically increment the old version number it finds in 
> a POM, rather than depending on the external fixed property 'newVersion'.
> _Patch attached:_ [^autoincrement-versions-maven-plugin-patch.txt]
> h3. Use case
> In a multi-module project, I have a number of child projects for which I 
> would like to increment the version number. The version numbers of the child 
> projects are not the same, so a single static 'newVersion' won't do.
> Functionally-speaking, this is a variant of the standard use case for the 
> 'set' goal, however, the 'newVersion' property does not have to be specified, 
> and the plugin attempts to automatically increment the 'oldVersion' found in 
> a POM it is going to change.
> I set the configuration property 'autoIncrementVersion' to enable this 
> behaviour, which is disabled by default.
> h3. Implementation
> I have relied on existing Maven project functionality (notably the 
> *maven-release-manager*, also used by the *maven-release-plugin*) to perform 
> the version increment functionality. A dependency on the 
> *maven-release-manager* has been added to the *versions-maven-plugin* POM, 
> and the code changes are localised to the 
> {{org.codehaus.mojo.versions.SetMojo}} class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to