Git Flow has been around for a long time and lots of people seem to be adopting it for as their favourite git workflow.
When it comes down to implementing Git Flow in a Java / Maven setting, I was wondering how one should approach versioning the software modules that live on all the branches below.
In a simplistic Maven world,
If all you had was a Develop and Master branch this would be ok, but how do you handle maven versioning in GitFlow.
The versions on the master are pretty easy to define, as they will be the versions that are ultimately created and released from the Release branch.
But as soon as code goes to a release branch, what versioning strategy do you deploy here ?
For release branch we should following 0.0.1-RC-SNAPSHOT
naming convention.
Also please explore the mvn jgitlfow plugin. Which will provide all the above discussed features .
Please include the following depedency.
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>${jgitflow-maven-plugin.version}</version>
<configuration>
<enableSshAgent>true</enableSshAgent>
<noDeploy>true</noDeploy>
<noReleaseBuild>true</noReleaseBuild>
<noFeatureBuild>true</noFeatureBuild>
<noHotfixBuild>true</noHotfixBuild>
<enableFeatureVersions>true</enableFeatureVersions>
<releaseBranchVersionSuffix>RC</releaseBranchVersionSuffix>
<allowSnapshots>true</allowSnapshots>
<pushReleases>true</pushReleases>
<pushHotfixes>true</pushHotfixes>
<pushFeatures>true</pushFeatures>
<flowInitContext>
<versionTagPrefix>v</versionTagPrefix>
</flowInitContext>
</configuration>
</plugin>
Example cammands
mvn jgitflow:release-start
creates a release branch with RC and updates develop branch pom to next version
mvn jgitflow:release-finish
Mergers relaese to master and develop and creates a tag : Mostly this branch goes Integration testing any bug fix are commited to the release branch, when it is closed develop also get the updates as it is merged.
creates a release branch with also updates the develop pom ie before (devlop 0.1-SNAPSHOT) After devlop 0.2-SNAPSHOT and a release branch of 0.1-RC-SNAPSHOT is create
https://bitbucket.org/atlassian/jgit-flow/wiki/Home
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With