build-helper-maven-plugin
build-helper-maven-plugin copied to clipboard
Option to override nextIncrementalVersion
Hi Team,
My understanding is that by default, the parse-versions goal, will generate the nextIncrementalVersion
by taking the current incremental version number and adding 1.
So, for example, if the current version in the pom is 2.3.1
, then the next version would be 2.3.2
.
In our Jenkins pipelines, we use something like this:
sh "mvn -B -U build-helper:parse-version --batch-mode ${env.VERSIONS_PLUGIN_GOALS} -DnewVersion='\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}' versions: commit"
The problem with this approach is that if we want to release the next minor version (e.g. 2.4.x), it is not possible to release 2.4.0.
Because if the version in the pom is 2.4.0
, then the above will generate 2.4.1
.
Is it possible to override the default behavior and don't change the version?
That is, a version 2.4.0
in the pom.xml, should remain 2.4.0
Thanks you in advance, Bill