To release a new version to Sonatype, follow these steps:
1. Prepare Credentials
Create a ~/.sbt/1.0/sonatype.sbt file with your credentials:
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", "<your username>", "<your password>")
2. Prepare the Build
- Temporarily remove
-SNAPSHOT from the version in build.sbt. - Uncomment
publishArtifact in (Compile, packageDoc) := false in build.sbt (ensure it is NOT commented out). - Append the contents of
dev/build.sbt.end to the end of your build.sbt. - Append the contents of
dev/plugins.sbt.end to the end of project/plugins.sbt.
3. Execute Publication
Run the following command to publish and sign the artifacts:
sbt "+ publishSigned"
Note: If you encounter a GPG error on macOS, install GnuPG via Homebrew: brew install gnupg.
4. Finalize on Sonatype
Log in to oss.sonatype.org, locate your item in "Staging Repositories", and click "Close" then "Release".