Codearte / gradle-nexus-staging-plugin

Automatize releasing Gradle projects to Maven Central.
Apache License 2.0
172 stars 26 forks source link

./gradlew closeAndReleaseRepository returns 401: Unauthorized #132

Closed denghejun closed 3 years ago

denghejun commented 4 years ago

./gradlew closeAndReleaseRepository -info Initialized native services in: /Users/hjdeng/.gradle/native The client will now receive all logging from the daemon (pid: 160). The daemon log file: /Users/hjdeng/.gradle/daemon/5.6.2/daemon-160.out.log Starting 11th build in daemon [uptime: 23 mins 18.643 secs, performance: 100%, non-heap usage: 28% of 268.4 MB] Using 8 worker leases. Starting Build Settings evaluated using settings file '/Users/hjdeng/coding/github/drift-programming/settings.gradle'. Projects loaded. Root project using build file '/Users/hjdeng/coding/github/drift-programming/build.gradle'. Included projects: [root project 'drift-programming']

Configure project : Evaluating root project 'drift-programming' using build file '/Users/hjdeng/coding/github/drift-programming/build.gradle'. All projects evaluated. Selected primary task 'closeAndReleaseRepository' from project : Tasks to be executed: [task ':closeRepository', task ':releaseRepository', task ':closeAndReleaseRepository'] :closeRepository (Thread[Execution worker for ':',5,main]) started.

Task :closeRepository Caching disabled for task ':closeRepository' because: Build cache is disabled Task ':closeRepository' is not up-to-date because: Task has not declared any outputs despite executing actions. Getting staging profile for package group 'org.drift' GET request failed. 401: Unauthorized, body:

Task :closeRepository FAILED :closeRepository (Thread[Execution worker for ':',5,main]) completed. Took 2.166 secs.

FAILURE: Build failed with an exception.

szpak commented 4 years ago

Related to #131? Could you answer the questions precised there and preferably send a link do your project and CI logs (if publicly available) or - if not - the project configuration related to releasing?

denghejun commented 4 years ago

Below is all of my gradle config. I don't config anything else. is that right?

plugins {
    id 'java'
    id "io.codearte.nexus-staging" version "0.21.1"
}

group 'org.drift'
version '1.0'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.2")
    testImplementation("org.junit.jupiter:junit-jupiter-api:5.5.2")
    testImplementation("org.mockito:mockito-core:3.0.0")
    testImplementation("org.mockito:mockito-junit-jupiter:3.0.0")
}

test {
    useJUnitPlatform()
}

nexusStaging {
    // optional if packageGroup == project.getGroup()
    packageGroup = "org.drift"
    // when not defined will be got from server using "packageGroup"
    // stagingProfileId = "yourStagingProfileId"
}
szpak commented 4 years ago

How do you provide credentials to Nexus?

Please take a look at the proper section in README.

szpak commented 4 years ago

@denghejun Have you been able to check what I asked 10 days ago?

szpak commented 3 years ago

Closing due to inactivity.