Skip to content

How to Publish a Repo

Tom Hicks edited this page May 26, 2016 · 43 revisions

How to Publish Locally

If you want to publish the changed version of a project locally, on your machine, use this command: sbt publish-local

Note: The following instructions are for repository administrators only!

Sonatype account

For public releases outside of our group, remote publishing is required. For remote publishing, please follow the instructions from this page: http://www.scala-sbt.org/release/docs/Using-Sonatype.html. These instructions work well, with a few observations:

Step #1: Sign Up with Sonatype

Sonatype is the company that provides support and tools for Maven central. Crucially, they provide the access point for making projects available in the Maven Central Repository. You need to create a free account at Sonatype's JIRA issue management system: https://issues.sonatype.org/

At this JIRA site, the "Community Support - Open Source Project Reposity Hosting (OSSRH)" project is where we can file an issue to request help, such as connecting a new Sonatype account to the CLU Lab repositories. https://issues.sonatype.org/browse/OSSRH

Once you have a Sonatype account and it is linked to the CLU Lab repositories, Sonatype's online Nexus Repository Manager is used to manage the publishing lifecycle. https://oss.sonatype.org/

Step #2: Install the sbt-pgp plugin

The plugin does a lot of the grunt work for us. Install it by following the simple instructions here: http://www.scala-sbt.org/sbt-pgp/.

  • Follow the instructions in the first section of this page to create and publish PGP keys (if you don't have them already). Then add your Sonatype credentials (from the account you created previously) to a central place on your machine, e.g., ~/.sbt/0.13/sonatype.sbt.

Publish to the Sonatype server

  • Make sure the version numbers match the version you plan to release in build.sbt, CHANGES, README.
  • git tag to create a tag with this version number.
  • Type sbt publishSigned in the project you plan to release to upload it as a "staging repository" to the Sonatype server.

Close/Release the project at Sonatype

  • Go to https://oss.sonatype.org/index.html#stagingRepositories and login with the account you created in the first step.
  • After login you should see a page with the available staging repositories that looks like this: Sonatype
  • Scroll to the bottom of the page to find your staging repository (the name should start with org.clulab).
  • Select the project. Then Close it (using the button in the top bar of the window). Wait a few seconds, then click Refresh. The Release button should now be active. Click it, and answer Yes to the question if the repository should be dropped (this just means it will be removed from Sonatype's list of staging repositories). This is it. The repository has now been pushed to Maven, and it should be publicly available in 3-4 hours.
  • (See this page for more details: http://central.sonatype.org/pages/releasing-the-deployment.html)

Advance the version number of the project

Advance the version number of the project, e.g., if you just released 5.8.1 the next version should be 5.8.2-SNAPSHOT. Commit and push the new number.

Rules for CLULab administrators:

  • Please do not release a repository without Mihai's approval.
  • Please do not create private repositories without Mihai's approval (we have a limited number of these).
  • Please do not change any permissions of the teams in the CLULab organization without Mihai's approval.