vanniktech / gradle-maven-publish-plugin

A Gradle plugin that publishes your Android and Kotlin libraries, including sources and javadoc, to Maven Central or any other Nexus instance.
https://vanniktech.github.io/gradle-maven-publish-plugin
Apache License 2.0
1.31k stars 120 forks source link

Received status code 401 from server: Content access is protected by token #868

Open strider1981 opened 2 weeks ago

strider1981 commented 2 weeks ago

While publishing the artifact I am getting the following error.

Failed to publish publication 'maven' to repository 'mavenCentral'. Could not PUT 'https://s01.oss.sonatype.org/service/local/staging/deployByRepositoryId. Received status code 401 from server: Content access is protected by token

I have generated a token from Nexus repo but how can I configure the plugin to use the token instead of user name and password?

ItzNotABug commented 4 days ago
  1. Generate a token via https://s01.oss.sonatype.org/#profile;User%20Token
  2. Use the given credentials for mavenCentralUsername & mavenCentralPassword in your ~/.gradle/gradle.properties.