You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Daniel Jones <da...@mendeley.com> on 2012/03/21 18:23:38 UTC

Plugin to Increment Project Version

Hi all,

I'm wondering if it would be possible/feasible to write a plugin that:

   1. Looks up the LATEST version of the current project
   2. Does some splitting on that version string to increment the minor
   revision by one
   3. Modifies the logical representation of the POM to the new version
   4. *Possibly* does some filtering that will then write the POM.xml file
   with the new version.

I'm guessing items 1 and 3 must exist in the codebase somewhere, so the
rest shouldn't be too hard. Has anyone attempted this before, and if not,
where would you recommend a developer completely new to Maven plug-ins
should look first?

-- 
Regards,
Daniel Jones | Software Engineer, Platform Team


Mendeley Ltd | London, UK | www.mendeley.com <http://www.mendeley.com/>
Registered in England and Wales | Company Number 6419015

Re: Plugin to Increment Project Version

Posted by Geoffrey De Smet <ge...@gmail.com>.
I believe the versions-maven-plugin is the closest what you need,
but it will not "increment the hotfix part of the version by one" 
correctly if you are working on a release branch (for example 1.2.x) and 
a higher release has been made (for example 1.3.0).

More info here:
   https://jira.codehaus.org/browse/MVERSIONS-185

Op 21-03-12 20:03, Brett Porter schreef:
> You can use this plugin for a wide range of version changes:
> http://mojo.codehaus.org/versions-maven-plugin/
>
> For automatic incrementing, you might look at the release plugin:
> http://maven.apache.org/plugins/maven-release-plugin/
>
> If neither of those do what you want, then it would probably be easier to make an enhancement to them rather than creating a new plugin. Rewriting the POM is not a tool we have generally available - both plugins have gone to some lengths to do that while preserving formatting, etc.
>
> - Brett
>
> On 22/03/2012, at 4:23 AM, Daniel Jones wrote:
>
>> Hi all,
>>
>> I'm wondering if it would be possible/feasible to write a plugin that:
>>
>>    1. Looks up the LATEST version of the current project
>>    2. Does some splitting on that version string to increment the minor
>>    revision by one
>>    3. Modifies the logical representation of the POM to the new version
>>    4. *Possibly* does some filtering that will then write the POM.xml file
>>    with the new version.
>>
>> I'm guessing items 1 and 3 must exist in the codebase somewhere, so the
>> rest shouldn't be too hard. Has anyone attempted this before, and if not,
>> where would you recommend a developer completely new to Maven plug-ins
>> should look first?
>>
>> -- 
>> Regards,
>> Daniel Jones | Software Engineer, Platform Team
>>
>>
>> Mendeley Ltd | London, UK | www.mendeley.com<http://www.mendeley.com/>
>> Registered in England and Wales | Company Number 6419015
> --
> Brett Porter
> brett@apache.org
> http://brettporter.wordpress.com/
> http://au.linkedin.com/in/brettporter
> http://twitter.com/brettporter

-- 
With kind regards,
Geoffrey De Smet



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Plugin to Increment Project Version

Posted by Brett Porter <br...@apache.org>.
You can use this plugin for a wide range of version changes:
http://mojo.codehaus.org/versions-maven-plugin/

For automatic incrementing, you might look at the release plugin:
http://maven.apache.org/plugins/maven-release-plugin/

If neither of those do what you want, then it would probably be easier to make an enhancement to them rather than creating a new plugin. Rewriting the POM is not a tool we have generally available - both plugins have gone to some lengths to do that while preserving formatting, etc.

- Brett

On 22/03/2012, at 4:23 AM, Daniel Jones wrote:

> Hi all,
> 
> I'm wondering if it would be possible/feasible to write a plugin that:
> 
>   1. Looks up the LATEST version of the current project
>   2. Does some splitting on that version string to increment the minor
>   revision by one
>   3. Modifies the logical representation of the POM to the new version
>   4. *Possibly* does some filtering that will then write the POM.xml file
>   with the new version.
> 
> I'm guessing items 1 and 3 must exist in the codebase somewhere, so the
> rest shouldn't be too hard. Has anyone attempted this before, and if not,
> where would you recommend a developer completely new to Maven plug-ins
> should look first?
> 
> -- 
> Regards,
> Daniel Jones | Software Engineer, Platform Team
> 
> 
> Mendeley Ltd | London, UK | www.mendeley.com <http://www.mendeley.com/>
> Registered in England and Wales | Company Number 6419015

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter
http://twitter.com/brettporter






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org