0

I'm currently learning Maven and I've been doing some testing with gitflow-maven-plugin, I have set up and get it work, now it can change the last digit of the versioning (so if the release version for master branch is 1.0.0, develop version is 1.0.1-SNAPSHOT), I tried to control the change of the digit by using :

mvn -B gitflow:release -DversionDigitIncrement=1

I tried to set DversionDigitIncrement to 0, 1, 2 but the only number changed is the last digit (which is the 'PATCH'), how can I test if the other two numbers change properly? Which commands I should ues or do I need to change configuration in POM file?

Been messing around for a whole day now. Many thanks. (I wanted it to follow semantic versioning naming rule)

wawawa
  • 2,835
  • 6
  • 44
  • 105

1 Answers1

2

try to use it after a release-start :

mvn -B gitflow:release-start
mvn -B gitflow:release-finish -DversionDigitToIncrement=0
mvn -B gitflow:release -DversionDigitToIncrement=0

OR if you want to change develop version at release-start :

mvn -B gitflow:release-start -DcommitDevelopmentVersionAtStart=true -DversionDigitToIncrement=0

In your case, 0 to major and 1 to minor

https://github.com/aleksandr-m/gitflow-maven-plugin#additional-goal-parameters

ste
  • 36
  • 2
  • Hi thanks, do I need other command if I use 'mvn -B gitflow:release-start -DcommitDevelopmentVersionAtStart=true -DversionDigitToIncrement=0'? – wawawa Nov 27 '19 at 11:36
  • and when I tried 'mvn -B gitflow:release-start', it gave me error: Error executing Maven. The specified user settings file does not exist: C:\.........\tart – wawawa Nov 27 '19 at 11:39
  • '-B gitflow:release-start -DcommitDevelopmentVersionAtStart=true -DversionDigitToIncrement=0' This works fine, it created a new release branch&update major (2.0.0-SNAPSHOT) in develop branch, but what's the command for next step, update versioning from release branch to master? I tried '-B gitflow:release-finish -DversionDigitToIncrement=0 -X' but it gave me 1.0.13 again – wawawa Nov 27 '19 at 12:33
  • Hi, Ithink with "mvn -B gitflow:release-start -DcommitDevelopmentVersionAtStart=true -DversionDigitToIncrement=0" you just need to do a "mvn -B gitflow:release-finish" not to increment digit version again. – ste Nov 28 '19 at 09:28