aleksandr-m / gitflow-maven-plugin

The Git-Flow Maven Plugin supports various Git workflows, including GitFlow and GitHub Flow. This plugin runs Git and Maven commands from the command line.
https://aleksandr-m.github.io/gitflow-maven-plugin/
Apache License 2.0
490 stars 182 forks source link

Adjusting master branch POM version after release #299

Closed shvalb closed 3 years ago

shvalb commented 3 years ago

Hi All,

We use the plugin in the context of Bitbucket pipelines. We have the following requirements in terms of pom versioning.

upon releasing a version, we are interested to update the branches versions as follow: master gets his minor version increased by one, 'develop' gets his minor version increased by one and patch digit is reset to '0' and annotated with SNAPSHOT.

for example: before release: master: 1.0.0 develop: 1.0.5-SNAPSHOT

after release: master: 1.1.0 develop: 1.1.0-SNAPSHOT

I tried to do it using -DversionDigitToIncrement=1 but the final results were: master: 1.0.6 develop: 1.1.0-SNAPSHOT

so it actually updated the develop branch as I hoped, but the master is not what I need, is there a way to control master branch version?

sorry for this long post... Thank you!

aleksandr-m commented 3 years ago

@shvalb How about using releaseVersion in start goal?

shvalb commented 3 years ago

Yep,,if I use version-maven-plugin then I can really manipulate the version as required. Thank for that !

Another question, as I mentioned, I run the build from Bitbucket pipelines, so if I'm on a feature branch and I put Pull-Request which was approved and merged so now I want to bump up the pom version on feature-finish using developmentVersion but this goal needs branchName in non-interactive mode. How can I provide it with branch name? I don't know it from within Bitbucket Pipelines, any idea?

aleksandr-m commented 3 years ago

@shvalb Which branch did you checked out? If feature is already merged then why do you need feature finish goal?

shvalb commented 3 years ago

Problem solved! thanks.

lrkwz commented 2 years ago

Yep,,if I use version-maven-plugin then I can really manipulate the version as required. Thank for that !

I'm intersted in this integration, can you post an example?