Skip to content

Instantly share code, notes, and snippets.

@anthavio
Last active August 29, 2015 14:00
Show Gist options
  • Save anthavio/11125365 to your computer and use it in GitHub Desktop.
Save anthavio/11125365 to your computer and use it in GitHub Desktop.
Releasing Maven Project
http://developer-blog.cloudbees.com/2014/02/how-to-do-maven-release-builds-from.html
http://wiki.cloudbees.com/bin/view/DEV/Sharing+Files+with+Build+Executors
export RLS_VERSION=1.0.0
export NXT_VERSION=1.0.1
mvn versions:set -DnewVersion=${RLS_VERSION}
git commit -m "Setting release version ${RLS_VERSION}"
git push origin
mvn clean deploy -Prelease
mvn versions:set -DnewVersion=${NXT_VERSION}
git commit -m "Setting next snapshot version ${NXT_VERSION}-SNAPSHOT"
git push origin
# settings.xml - scm server username/password
# release:prepare - version change (release) + git release tagging + version change (snapshot)
# http://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html
mvn --batch-mode clean release:clean release:prepare -DautoVersionSubmodules=true -DdryRun=true
# settings.xml - sonatype server username/password & gpg passphrase
# release:perform - deploy + site-deploy from release.properties
# http://maven.apache.org/maven-release/maven-release-plugin/examples/perform-release.html
mvn release:perform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment