-
Notifications
You must be signed in to change notification settings - Fork 1
Maven Central: Deploy Process
Siddharth Kothari edited this page Jul 26, 2019
·
2 revisions
We use Sonatype for releasing the artifacts. Follow the guide at https://central.sonatype.org/pages/ossrh-guide.html for the overview.
- Create a settings.xml file of the following format:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
<servers>
<server>
<id>ossrh</id>
<username>{username}</username>
<password>{password}</password>
</server>
</servers>
</settings>
-
Create a GPG key and distribute it to public key servers. Read more here - https://central.sonatype.org/pages/working-with-pgp-signatures.html.
-
Perform the release with the following command:
mvn release:perform -Darguments=-Dgpg.passphrase=${gpg_passphrase} -s /path/to/settings.xml
Things to keep in mind while performing the release:
- The pom.xml in origin HEAD should point to the release candidate version (whether it's x.y.z or x.y.z-SNAPSHOT)
-
mvn release:clean release:preparecommand will create therelease.propertiesfile necessary for performing the release with the above command. It will also push the relevant tags to the Github repo based on the latest HEAD commit. - Finally, the release:perform command will take into account the tag present in the
release.propertiesfile.
An example release.properties file looks like:
#release configuration
scm.tagNameFormat=@{project.artifactId}-@{project.version}
scm.tag=1.2.0
pushChanges=true
scm.url=scm\:git\:git@github.com\:appbaseio/appbase-droid.git
preparationGoals=clean verify
project.scm.io.appbase\:appbase-droid.tag=HEAD
project.scm.io.appbase\:appbase-droid.connection=scm\:git\:git@github.com\:appbaseio/appbase-droid.git
project.scm.io.appbase\:appbase-droid.url=git@github.com\:appbaseio/appbase-droid.git
project.rel.io.appbase\:appbase-droid=1.2.0
project.scm.io.appbase\:appbase-droid.developerConnection=scm\:git\:git@github.com\:appbaseio/appbase-droid.git
remoteTagging=true
scm.commentPrefix=[maven-release-plugin]
project.dev.io.appbase\:appbase-droid=1.2.2-SNAPSHOT
exec.snapshotReleasePluginAllowed=false
completedPhase=end-release