I'm testing versioning in IntelliJ with gitflow-maven-plugin, I wanted to update major and minor manually:
mvn -B gitflow:release-start -DcommitDevelopmentVersionAtStart=true -DversionDigitToIncrement=0
After this command, a new release branch created, called 'release/1.0.14', now the develop branch verison in pom file is '1.1.0-SNAPSHOT'(which is what I want, it updates the minor, but I'm not sure why it's 1.0.14 in releasing branch), next step is to update to master branch, I tried:
-B gitflow:release-finish -DversionDigitToIncrement=0 -X
but it's not what I want, I guess the master will be updated to 1.0.14 first and 1.1.0 next? But after this command, the version in develop became 1.0.15-SNAPSHOT, not sure what's the right way to do this, any thoughts would be appreciated.
Gitflow defines two permanent branches (
masteranddevelop). Themasterbranch contains a production ready version (a released version). If you start a release your current code base fromdevelopis used to create torelease/x.y.zbranch and when you finish your release therelease/x.y.zbranch is merged back tomasterand alsodevelop.The version update is done in the goal:
release-startand you can influence the order in which thedevelopbranch is updated with:commitDevelopmentVersionAtStarte.g. Version in
pom.xmlon branchdevelopmentis1.0.14-SNAPSHOTif you now perform:You should end up with a new release branch
release/1.0.14having version1.0.14and the version in youpom.xmlon branchdevelopmentis updated to1.1.0-SNAPSHOTthe version onmasteris not updated (yet). To "update" the version onmasteryou need to finish the release.I kind of misunderstood your question - therefor I've added also this part which you've asked in an other question.
Have a look at the docu at: gitflow-maven-plugin (search for:
versionDigitToIncrement)Comming from
1.0.14-SNAPSHOT:versionDigitToIncrement: 0updates the major version ondevelopmentto2.0.0-SNAPSHOT.versionDigitToIncrement: 1updates the major version ondevelopmentto1.1.0-SNAPSHOT.versionDigitToIncrement: 2updates the major version ondevelopmentto1.0.15-SNAPSHOT.But it seems that the
-DversionDigitToIncrementpassed on the cli is ignored. Setting it in the configuration area in yourpom.xmlleads to the expected results.