build-helper-maven-plugin icon indicating copy to clipboard operation
build-helper-maven-plugin copied to clipboard

Option to override nextIncrementalVersion

Open billbos-sgd opened this issue 2 years ago • 0 comments

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

billbos-sgd avatar Feb 14 '23 00:02 billbos-sgd