tirsdag 29. september 2009

Maven: updating you version tags

When you create another branch of your multimodule maven project, updating version tags all over the hierarchy can be a pain. You keep that snippet of code that does the job with 'find -iname pom.xml | xargs sed -e 's/4.0-SNAPSHOT/5.0-SNAPSHOT/g' .. and it works in most of the cases.

But there's another way: using the maven-versions-plugin. It allows you to change the pom version and parent version with a single target, e.g. mvn versions:set -DnewVersion=4.0b-SNAPSHOT.

Now, all of your maven modules in this project have been updated to the correct version, and their parent dependencies as well. Voilà :)

Ingen kommentarer:

Legg inn en kommentar