How to Publish to Maven Central

Pre-requisites

  1. Skim http://central.sonatype.org/pages/ossrh-guide.html
  2. And http://central.sonatype.org/pages/requirements.html
  3. Setup gpg http://central.sonatype.org/pages/working-with-pgp-signatures.html
  4. Setup password http://central.sonatype.org/pages/apache-maven.html (under Distribution Management and Authentication)
  5. Go to https://oss.sonatype.org/ and follow the directions at http://central.sonatype.org/pages/releasing-the-deployment.html

Basic workflow

  1. cd to the project source dir
  2. run the following command to sign into your gpg key (can run as a script):
    output=$(mktemp)
    rm $output
    gpg2 --use-agent --armor --detach-sign --output $output pom.xml
    rm $output
  3. check out the release tag
  4. deploy the project via maven
  5. go to https://oss.sonatype.org/#stagingRepositories and log in
  6. find the recently created repository corresponding to your build
  7. select the repository and click 'close' - wait a while for it to be closed (hit refresh to check status)
  8. click 'release' (keep the 'drop' box checked)
  9. check maven central for the artifacts (may take an hour or so)
  10. ...
  11. profit!

geomesa

  • build command: mvn clean deploy -Pcentral,bigtable -DskipTests
  • repository name: orglocationtechgeomesa-xxxx

geomesa-geoserver

  • build comand: mvn clean deploy -Pcentral -DskipTests
  • repository name: orggeomesa-xxxx