Skip to content

Generate a Token on OSSRH Sonatype Nexus Repository Manager servers⚓︎

Central Publisher Portal Publishers

This documentation is for publishing via OSSRH. For publishing via the Central Publisher Portal, please see the Portal token documentation.

You must generate a token to publish artifacts to the Central Repository via OSSRH.

Tokens are per-server

You must generate a token on the OSSRH server your are going to use for publishing. OSSRH tokens are per-server, so you cannot use a token generated on oss.sonatype.org for publishing via s01.oss.sonatype.org, as an example.

  1. Go to the Nexus Repository Manager web interface where your project is hosted
  2. Select the Profile option in the yellow top right dropdown menu
    • This should open the Profile tab in the main window
  3. In the Profile tab, select the User Token option in the select input field
    • This should navigate to the User Token view in the tab
  4. Click the Access User Token button (you will need to reenter your credentials) token
  5. You can now use that generated token in your publishing setup
    <server>
      <id>${server}</id>
      <username>tokenuser</username>
      <password>tokenkey-dlghnfgh8+4LfXmg5Hsd8jd</password>
    </server>
    

More detailed information of the token's usage can be found here.