Skip to content

Publishing with Sonatype

Ryan Parman edited this page Aug 23, 2016 · 12 revisions

Publishing to Maven Central via Sonatype

First, follow the instructions for installing gpg and creating a key file.

Once you've done that, you should create a gradle.properties file 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, select it, and then click the Release button near the top of the page (other buttons near it include Drop, Refresh, Close, 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