Skip to content

DeploymentToMavenCentralRepository

dpocock edited this page Feb 21, 2013 · 3 revisions

The Sonatype.org service is used to deploy to Maven

They provide a detailed document about their process https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

Here is an abbreviated summary:

<settings>
  <servers>
    <server>
      <id>sonatype-nexus-staging</id>
      <username>d_pocock</username>
      <password>your JIRA password</password>
    </server>
  </servers>
</settings>
  • make sure you have a PGP key, signed, and uploaded to pool.sks-keyservers.net
  • make sure the email address matching your PGP ID is added to the developers list in the pom.xml file
  • now run the maven command:
mvn deploy -DperformRelease=true -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging

Everything should happen automatically. The performRelease argument tells Maven that you want to sign the JARs, if you leave that out, they won't be signed and can't be uploaded to an official repository.

  • Now go and log in here: https://oss.sonatype.org
  • click the `Staging Repositories' link
  • select the repository and click close
  • select the repository and click release

These last steps can be automated with another plugin in the pom.xml if necessary

Clone this wiki locally