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.
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.
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.