Maven release plugin - how to bump version of release project

Viewed 7111

I am using maven release plugin with Jenkins for CICD. For various reasons, we don't do SNAPSHOTs as we are supposed. We set up Jenkins to run build against master branch with version like 0.1, 1.0. And we would like to up the version number of release every time we run Jenkins. These are the commands I had in Jenkinsfile:

sh "mvn -B release:clean"
sh "mvn -B release:prepare"
sh "mvn -B release:perform"

Ended up getting error You don't have a SNAPSHOT project in the reactor projects list. No surprise there since release:prepare always looks for a SNAPSHOT branch. Is there a way to get around it? I found this option -DignoreSnapshots for prepare but it did not work.

2 Answers
Related