I've just started working with Maven which I'm trying to integrate into a Jenkins job.
The current workflow I'm trying to automate is to merge the dev branch (pom version 2.16.0-SNAPSHOT) into staging which is where we build our release candidates, so here we the versions and sub modules to go from 2.16.0-SNAPSHOT to just 2.16.0.
In 'goals' section of the Maven plugin for Jenkins I've got the following
-o -B release:prepare -DremoteTagging=false install -U
In my Jenkins console during the build I can see it change to the version without the snapshot, but then it changes back? What am I missing?
The release:prepare
goal performs a handful of tasks. If your only objective is to remove SNAPSHOT from all the module versions you can use Versions Maven Plugin e.g.:
mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
which should result in version being updated:
...
[INFO] Processing com.something.something:module
[INFO] Updating parent com.something.something:module
[INFO] from version 1.0.0-SNAPSHOT to 1.0.0
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With