Skip to content

Instantly share code, notes, and snippets.

@pdemanget
Last active November 20, 2020 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdemanget/5f0307432492d300ba691aa37312df12 to your computer and use it in GitHub Desktop.
Save pdemanget/5f0307432492d300ba691aa37312df12 to your computer and use it in GitHub Desktop.
Using maven versions plugin to release
# On release localement:
# - On laisse l'utilisateur choisir de pousser on pas son tag et son commit
# - Au choix remplacer l'install par un deploy, ou revenir sur le tag pour lancer le deploy.
# mvn -q versions:set -DnewVersion=1.1.0-SNAPSHOT -DprocessAllModules -DgenerateBackupPoms=false
JAVA_HOME=/opt/lib/jdk11/
echo set RELEASE version
mvn -q versions:set -DremoveSnapshot -DprocessAllModules
version=$(mvn -B -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec )
echo Will tag version $version
git add pom.xml
git add */pom.xml
git commit -m "[version] $version"
git tag v$version
mvn clean install
echo set SNAPSHOT version
mvn -q versions:set -DnextSnapshot -DprocessAllModules
version=$(mvn -B -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec )
mvn -q versions:commit
git add pom.xml
git add */pom.xml
git commit -m "[version] $version"
git tag v$version
echo Updated SNAPSHOT to version $version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment