Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing to sonatype fails with 401 #356

Open
Martmists-GH opened this issue Dec 18, 2024 · 0 comments
Open

Publishing to sonatype fails with 401 #356

Martmists-GH opened this issue Dec 18, 2024 · 0 comments

Comments

@Martmists-GH
Copy link

I made sure to create a token and stored the credentials in my properties file, and I am sure they are set as username/password.

I configured the nexusPlugin as described in the readme:

nexusPublishing {
    repositories {
        sonatype {
            nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
            snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))

            username = if (project.hasProperty("mavenCentralUser")) {
                project.properties["mavenCentralUser"] as? String
            } else {
                System.getenv("MAVEN_CENTRAL_USER")
            } ?: error("No maven user found")
            password = if (project.hasProperty("mavenCentralToken")) {
                project.properties["mavenCentralToken"] as? String
            } else {
                System.getenv("MAVEN_CENTRAL_TOKEN")
            } ?: error("No maven token found")
        }
    }
}

but I still get


> Task :initializeSonatypeStagingRepository FAILED
Caching disabled for task ':initializeSonatypeStagingRepository' because:
  Caching has not been enabled for the task
Task ':initializeSonatypeStagingRepository' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
No stagingProfileId set, querying for packageGroup 'com.martmists.ndarray-simd'
49 actionable tasks: 4 executed, 45 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':initializeSonatypeStagingRepository'.
> Failed to load staging profiles, server at https://s01.oss.sonatype.org/service/local/ responded with status code 401, body: 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant