OSSRH Sunset Notice
The legacy OSSRH publishing service will be sunset on June 30th, 2025. This documentation is for informational purposes and will be removed at that time. If you are currently publishing via this service, please migrate to the new Central Portal Publisher Service.
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 Central 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.
- Go to the Nexus Repository Manager web interface where your project is hosted:
- This is likely oss.sonatype.org or s01.oss.sonatype.org
- Select the Profile option in the yellow top right dropdown menu:
- This should open the Profile tab in the main window
-
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
User Token not found
In the case where you cannot find User Token in the drop-down list, please close the Profile tab and refresh the browser page. The User Token should become visible next time you try. This is a known issue in the Nexus UI.
-
Click the Access User Token button (you will need to reenter your credentials)
- 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 about the token's usage can be found here.