Wiki

Clone wiki

jgit-flow / Home

Maven JGit-Flow Plugin

Current Version: 1.0-m5.1

The Maven JGit-Flow Plugin is based on and is a replacement for the maven-release-plugin enabling support for git-flow style releases via maven.

git-flow

If you're new to git-flow, or never heard of it, see:

For more in-depth information about git flow and how git flow can help your business, check out our git flow guide.

Features

While this plugin is primarily used to perform releases, it also provides full git-flow functionality including:

  • starting a release - creates a release branch and updates pom(s) with release versions
  • finishing a release - runs a maven build (deploy or install), merges the release branch, updates pom(s) with development versions
  • starting a hotfix - creates a hotfix branch and updates pom(s) with hotfix versions
  • finishing a hotfix - runs a maven build (deploy or install), merges the hotfix branch, updates pom(s) with previous versions
  • starting a feature - creates a feature branch
  • finishing a feature - merges the feature branch

Differences with the Maven Release Plugin

Although this plugin is based on the maven-release-plugin, it does things a bit differently to provide a cleaner workflow.

The differences are:

  • doesn't create any .backup or release.properties files (or any other files in your working tree)
  • makes all changes on branches. This means to "roll-back" you can simply delete the branch
  • automatically copies any profiles (-P) and user-properties (-D) passed on the command line to the forked maven process when building
  • doesn't run site-deploy
  • provides the ability to completely turn off maven deployment
  • provides the ability to completely turn off remote pushes/tagging
  • Only builds your project once in the finish goal. e.g. if you do release-start and release-finish together, your tests only run once
  • Never clones your project to a temp folder
  • auto tracks origin based on maven scm values if origin tracking is not already setup (I'm looking at you Bamboo!)
  • master branch is always kept at the latest release version (not a SNAPSHOT)

Getting the Plugin

The Maven JGit-Flow Plugin is hosted in the maven central repository and can be added to your pom.xml like this:

<build>
    <plugins>
        <plugin>
            <groupId>external.atlassian.jgitflow</groupId>
            <artifactId>jgitflow-maven-plugin</artifactId>
            <version>1.0-m5.1</version>
            <configuration>
                <!-- see goals wiki page for configuration options -->
            </configuration>
        </plugin>
    </plugins>
</build>

For specific plugin configuration options, see the Goals page

Updated