Skip to content

maven project publishing locally, to github (+ github release), to jcenter bintray. (not maven central)

Notifications You must be signed in to change notification settings

daggerok/publish-maven-project-to-jcenter

Repository files navigation

publish maven projects to jcenter bintray Download

this repo example has been published here

build

./mvnw

run

java -jar app/target/*-all.jar

publish project artifacts as maven repository to local filesystem

./mvnw -P publish-locally

maven-release-plugin (locally)

./mvnw release:clean release:prepare release:perform \
        -Darguments="-DskipTests -Dmaven.deploy.skip=true -Pmaven-release-locally,publish-locally" \
        -Pmaven-release-locally,publish-locally -s ./settings.xml \
        -DgenerateBackupPoms=false \
        -Dresume=false \
        -DdryRun=false \
        -DskipTests \
        --batch-mode
#if something goes wrong:
#./mvnw release:rollback -s ./settings.xml

publish project artifacts as maven repository to github

./mvnw clean
./mvnw -P publish-locally
# create manually on your github repository branch: maven
./mvnw -P publish-to-github -pl :publish-maven-project-to-jcenter -s settings.xml

upload github release

  • prepare settings.xml file:
    cp -Rf settings.template.xml settings.xml
  • update it accordingly: //servers/server/github
  • run commands:
    ./mvnw clean package
    ./mvnw -P upload-github-release -pl :publish-maven-project-to-jcenter -s settings.xml

publish project artifacts to bintray jcenter maven repository

by using maven-release-plugin

  • update settings.xml file accordingly //servers/server/bintray-daggerok-repo username => bintray API key
  • first time open https://bintray.com/daggerok/daggerok and create new package, ie: publish-maven-project-to-jcenter
  • once repository was created, prepare / perform release using maven-release-plugin
    ./mvnw release:clean release:prepare release:perform \
            -DgenerateBackupPoms=false \
            -Darguments="-DskipTests" \
            -Pmaven-release-jcenter \
            -s ./settings.xml \
            -Dresume=false \
            -DdryRun=false \
            -DskipTests \
            --batch-mode
    #if something goes wrong:
    #./mvnw release:rollback -s ./settings.xml

links