I have a maven multi module project.
When the code is development complete, we would want to write a branch build job in Jenkins which branches the code, increment the pom versions in the trunk, and remove the -SNAPSHOT from the pom versions in the branch.
So, if the trunk is 2.2-SNAPSHOT, by the end of the operation, the trunk should be 2.3-SNAPSHOT, and the newly created branch should have poms with 2.2.
When I use release:branch the trunk is getting updated but it's not removing the -SNAPSHOT from the poms in the branch.
Please let me know if you have any ideas of achieving this.
Thanks in advance.
From Maven Release plugin: Create a branch
By default, the POM in the new branch keeps the same version as the local working copy, and the local POM is incremented to the next revision. If you want to update versions in the new branch and not in the working copy, run:
mvn release:branch -DbranchName=my-branch -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false
Note: This can be useful if you want to create a branch from a tag
As an alternative, you might want to try the Versions Maven plugin:
mvn versions:set versions:commit -DnewVersion=2.2.0
You would still need to create the branch by hand though...
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