lumidion / sbt-sonatype-central

An sbt plugin for deploying open-source artifacts to Maven via the Sonatype Central portal
MIT License
5 stars 1 forks source link

SBT Sonatype Central

A plugin for deploying open-source artifacts to Maven via the Sonatype Central portal

Getting Started

Prerequisites: Make sure that you are running sbt 1.9.0 or higher.

  1. Add the following to your project/plugins.sbt file (or equivalent):
addSbtPlugin("com.lumidion"   % "sbt-sonatype-central"  % "0.1.0") //For deploying your lib to Sonatype Central
addSbtPlugin("com.github.sbt" % "sbt-pgp"               % "2.2.1") //For signing the lib before it is deployed
addSbtPlugin("com.github.sbt" % "sbt-git"               % "2.0.1") //For adding source control information to your package.
  1. Make sure that your version is not a snapshot (Sonatype Central does not support publishing snapshot versions). Add the following to your build.sbt file (or equivalent):
publishTo := sonatypeCentralPublishToBundle.value
  1. Follow the guide to setting up your gpg credentials here if you have not already done so.

  2. Generate a portal token in Sonatype Central, as illustrated in the following guide. Set the resultant username and password in your environment via the SONATYPE_USERNAME and SONATYPE_PASSWORD environment variables.

  3. Start the sbt shell by running sbt.

  4. Run publishSigned from the sbt shell and input your gpg password when prompted.

  5. Run either sonatypeCentralUpload or sonatypeCentralRelease from the sbt shell.