Project release and version management using gradle and git
Two very useful Gradle plugins:
1. axion-release-plugin https://github.com/allegro/axion-release-plugin
This plugin derives project version from tags in git repository. I use following rules in my projects:
- Start with default version 0.1.0-SNAPSHOT
- Every release of master branch increments second digit
- Production emergency fixes are done on a branch, which is created from the version tag. Such branch name must start with "hotfix-" prefix. Releasing this branch will increment 3rd digit.
- Feature branches must have "topic-" prefix. They are never released, however their version includes feature name.
To check current project version run “gradle currentVersion” To release the project run “gradle release”
2. gradle-nexus-plugin https://github.com/bmuschko/gradle-nexus-plugin
This plugin adds ability to upload project artifacts to nexus repository. Simply run “gradle upload”.
Example gradle.build
Written on July 12, 2016