Skip to content

Publishing with Sonatype

Moira Tagle edited this page Oct 17, 2016 · 12 revisions

Publishing to Maven Central via Sonatype

First, follow the instructions for installing GPG and creating a key file. You will need a version of GPG < 2.1.

Once you've done that, you should create a gradle.properties file in your ~/.gradle directory with the following properties to avoid specifying the same information every time you want to publish:

signing.keyId=<YourKeyId>
signing.password=<YourPublicKeyPassword>
signing.secretKeyRingFile=<PathToYourKeyRingFile>

ossrhUsername=<your-jira-id>
ossrhPassword=<your-jira-password>

After that, you should be able to run the gradle uploadArchives task successfully.

To publish a snapshot to Sonatype, just make sure that the version number ends in -SNAPSHOT; to avoid doing so, just make sure it doesn't.

You can then manage your builds (you may need to log in first). If you want to publish a release, click Staging Repositories on the left sidebar under the Build Promotion header, find the repository you want to release. You will first need to Close the repository (This just prevents modification of repository). After that is completed, you will be able to Release the repository. (The location of these commands is near the top of the pane, accompanied by Drop, Refresh, and Promote). Your build should be published shortly afterward, although it may not be visible via Maven search for another couple of hours.

Clone this wiki locally