Gitflow Maven Plugin
gitflow-maven-plugin
provides Maven support for Vincent Driessen's branching model http://nvie.com/posts/a-successful-git-branching-model/.
Think of gitflow-maven-plugin
as the maven-release-plugin
for the Gitflow branching model.
The plugin uses GGitflow, therefore it uses the git console directly under the hood rather than JGit.
Maven settings
Add the following to your Maven settings.xml
<pluginGroups>
<pluginGroup>com.dkirrane.maven.plugins</pluginGroup>
</pluginGroups>
Credentials
For Git https connections a git credential.helper
or a netrc
file allows you to permanently store the repo credentials to use when you clone, pull, push or fetch. Note, the netrc
file does require you to store your passwords in plain text.
Windows
- Store your Git credentials with git credential.helper or
- Create a text file called
_netrc
in your home directory (%USERPROFILE%/_netrc
). - Add credentials to the file for the Git server in the same format as described below.
Linux or OSX
- Store your Git credentials with git credential.helper or
- Create a file called
.netrc
in your home directory (~/.netrc
). - Add credentials to the file for the Git server in the same format as described below.
chmod 600 ~/.netrc
Sample netrc file
machine github.com
login myusername
password mypassword
machine api.github.com
login myusername
password mypassword
Goals
Sample POM configuration
Add the following to your top-level parent aggregator POM.
<plugin>
<groupId>com.dkirrane.maven.plugins</groupId>
<artifactId>ggitflow-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<!-- Optional Config For all parameters see: -->
<!-- http://dkirrane.github.io/ggitflow-maven-plugin/plugin-info.html -->
<!--
<prefixes>
<masterBranch>master</masterBranch>
<developBranch>development</developBranch>
<featureBranchPrefix>feature/</featureBranchPrefix>
<releaseBranchPrefix>release/</releaseBranchPrefix>
<hotfixBranchPrefix>hotfix/</hotfixBranchPrefix>
<supportBranchPrefix>support/</supportBranchPrefix>
<versionTagPrefix>v-</versionTagPrefix>
</prefixes>
<msgPrefix>[ggitflow-maven-plugin]</msgPrefix>
<msgSuffix>+review @reviewer123</msgSuffix>
<enableFeatureVersions>true</enableFeatureVersions>
<releaseProfiles>my-profile1, my-profile2</releaseProfiles>
-->
</configuration>
</plugin>
ggitflow-maven-plugin
uses the git console therefore the below Maven commands must be run from a git terminal like Git BASH Git for Windows
Start & Finish a Feature branch
mvn gitflow:feature-start
mvn gitflow:feature-finish
Start & Finish a Release branch
mvn gitflow:release-start
mvn gitflow:release-finish
Start & Finish a Hotfix branch
mvn gitflow:hotfix-start
mvn gitflow:hotfix-finish
Start a Support branch
mvn gitflow:support-start
Tag a Support branch
mvn gitflow:tag
Repository
Snapshots of this plugin can be downloaded from Sonatype OSS. Simply add the following to your pom.
<pluginRepositories>
<pluginRepository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
Authors and Contributors
Desmond (Dessie) Kirrane (@dkirrane)