Gitflow versioning plugin for gradle
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status Download

This project is a GitFlow versioning plugin for gradle.

This plugin will infer the version number to use for your project based on the state of the git repository.


Apply the plugin and add it as a classpath dependency as demonstrated below:

Example build.gradle:

apply plugin: ''

buildscript {
    repositories {
    dependencies {
        classpath ''

That's all it takes, the plugin will set the version attribute of your build automatically.

How does it work?

The plugin uses jgit to infer the version number from the state of the repository.

The version can be inferred without needing to add or alter any tasks in the gradle task graph.

Release Version

A tagged commit of the format major.minor.patch (on any branch) will be determined as a release version.

Unreleased Version

For any commit that is not tagged with a release version (major.minor.patch) an "unreleased" version will be inferred.

By default, an unreleased version is as follows:
| | | | |                 |       |
| | | | |                 |       └ "dirty" is ppended if the commit is dirty
| | | | |                 └ Short commit id
| | | | └ Branch name
| | | └ Number of commits since last tag
| | └ Patch version for last release version
| └ Minor version for last release version
└ Major version for last release version

If the repository has never been tagged for a release the version will default to 0.0.0


The following can be configured:

  • Unreleased version template

Refer to the configuration section of the wiki for detailed instructions on how to configure the plugin.