Last active
September 7, 2016 11:02
-
-
Save rnorth/bae7d984eedfdcac5180a19520dcda0f to your computer and use it in GitHub Desktop.
Alternative tool for performing Maven Releases - simpler and easier to reason about
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Maven release helper. Copyright (c) 2016 Richard North <rich.north@gmail.com> | |
# Usage: mvn-release.sh PROFILES | |
# where PROFILES should be any maven profile activations to pass through, e.g. `-PprofileA` | |
# | |
# Based on this article: https://axelfontaine.com/blog/final-nail.html | |
# | |
# IMPORTANT: follow setup steps in that article for required POM configuration settings | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
# set -o xtrace | |
echo "What is the release version number? (e.g. 1.0.1): " | |
read RELEASE_VERSION | |
# Update the version number | |
mvn versions:set -DnewVersion=$RELEASE_VERSION $@ | |
# Ensure the version number change is committed | |
git commit -a -m "Update release version number to $RELEASE_VERSION" || true | |
# Deploy then tag on success | |
mvn clean deploy scm:tag $@ | |
echo "What is the next snapshot version number? (e.g. 1.0.2-SNAPSHOT): " | |
read NEXT_VERSION | |
# Update the version number | |
mvn versions:set -DnewVersion=$NEXT_VERSION $@ | |
# Ensure the version number change is committed | |
git commit -a -m "Update development version number to $NEXT_VERSION" | |
git push --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment