maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Podgursky <>
Subject Using Git tags to cut releases to Maven Central from TravisCI
Date Wed, 31 Jul 2019 15:50:51 GMT
I've been experimenting with setting up Maven Central publishing from a
TravisCI build (since it's free for my OSS GitHub project), and I ended up
with a pattern that I think is pretty nice to work with (I've struggled
with the maven-deploy-plugin in the past).

I've written it up here
tl,dr, the key thing I haven't seen used widely is the use of tags to
define release versions, eg:

if [ ! -z "$TRAVIS_TAG" ]
    mvn --settings "${TRAVIS_BUILD_DIR}/.travis/mvn-settings.xml"
org.codehaus.mojo:versions-maven-plugin:2.1:set -DnewVersion=$TRAVIS_TAG
1>/dev/null 2>/dev/null
    echo "No tags, using snapshot version from pom.xml"

mvn deploy -P publish -DskipTests=true --settings

This lets me cut a central release by just pushing a tag:

$ git tag 1.23
$ git push origin 1.23

I've used Maven a fair amount but I wouldn't consider myself perfectly in
tune with best practices, so I'm curious what others think of this
approach, or if there are other streamlined central deploy setups
(especially from CI/Travis) that I missed.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message