Status code: 401, reason phrase: Content access is protected by token

Dear Support Team,

I am currently experiencing an issue while trying to deploy a dependency using a user token generated from Maven Central: My Account.

Despite following the necessary steps, I encounter the following error during the deployment process:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.718 s
[INFO] Finished at: 2024-07-30T11:56:59+05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy (injected-nexus-deploy) on project dependency-test: Failed to deploy artifacts: Could not transfer artifact io.github.mhryrehman:dependency-test:jar.asc:sources:0.0.1-20240730.065642-1 from/to ossrh (Index of /repositories/snapshots): status code: 401, reason phrase: Content access is protected by token (401) → [Help 1]

Could you please provide support on this issue and let me know if I am missing any steps? If further information is required from my side, please let me know. My pom.xml file is also given at bottom.

Thank you for your assistance.

Best regards,

Yasir Rehman
mhryrehman@gmail.com

Hello Yasir,

We verified that you have reset your token after posting it on a public forum. We have followed up with you directly through your request to our central-support@sonatype.com channel.

For everyone who has come across this post, please understand the importance of keeping your Maven Central publishing credentials private (including from Sonatype support staff). For more information, please see our policy on credentials.

The answer to this particular issue is that tokens generated via the Central Publisher Portal cannot be used for OSSRH, which have their own tokens.

Thank you

2 Likes

Hello Yasir - In support of @akeibler’s note above, I removed the credentials from your original post in an abundance of caution.

2 Likes

Hi Amelia,

Thank you for your support. I am currently unable to log in to https://s01.oss.sonatype.org/ using the same credentials I use for https://central.sonatype.com/ and https://community.sonatype.com/. I receive the error message: “Incorrect username, password, or no permission to use the Nexus User Interface. Try again. Please login before attempting further requests.”

Could you please guide me on which credentials should be used to log in to https://s01.oss.sonatype.org/?

Hello Yasir,

As we mentioned in the response to your support request email, your account does not have access to OSSRH. We would prefer you follow up via that email thread to address your request, as it is specific to your account and not a broadly-applicable question.

Thank you