There are two main use cases:
- Release version - includes new features or bug fixes (advancing the major or minor version)
- Support version - creating a patch for a released version
The following procedures have the following assumptions:
- The build in Travis-CI is triggered also for new git tags
- When new git tags are built in Travis-CI deployment to Bintray and sync to Maven Central are also executed
- The
masterbranch is protected - direct commits are disabled - New code is merged to
masterfrom either forks or other branches only by pull requests
Guidelines:
- Increase the major version only for breaking API changes or very big changes
- Increase the minor version for new features and bug fixes
Process:
- Create a release branch from
mastergit checkout master git pull git checkout -b release/<version> - Change the project version to
<version>Follow the build process in Travis to make sure it passes successfullymvn versions:set -DnewVersion=<version> git add pom.xml git commit -m 'Relesae version <version>' git push origin release/<version> - Tag the release version
Follow the build process in Travis to make sure it passes successfully
git tag v<version> git push --tags - Check and verify deployment:
- The new version was uploaded and published to Bintray
- The new version was synced to Maven Central (might take ~10 minutes to update)
- Change the project version to the next snapshot version
mvn versions:set -DnewVersion=<version+1>-SNAPSHOT git add pom.xml git commit -m 'Next snapshot version: <version+1>-SNAPSHOT' git push origin release/<version> - Create a pull request to merge the release branch back to
master - Create and publish a release in GitHub, based on the new tag
- Delete the release branch
Guidelines:
- Increase the patch version for mandatory hot fixes or for non-functional changes
Process:
The process for releasing a support (patch) version is very similar to the process of a release version,
but has the following differences:
- Create the support branch from the tag of the base version you want to patch
git fetch git checkout v<base-version> git checkout -b support/<version> - Change the project version to
<version> - Make your changes
- Tag the support version
- Check and verify deployment
- Change the project version to the current snapshot version
- Create a pull request to merge the support branch into
master - Create and publish a release in GitHub, based on the new tag
- Delete the support branch