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

Execution failed for task ':closeRepository'. #217

Open
softknife2021 opened this issue Jul 11, 2022 · 6 comments
Open

Execution failed for task ':closeRepository'. #217

softknife2021 opened this issue Jul 11, 2022 · 6 comments

Comments

@softknife2021
Copy link

Configure build.gradle and ran this command but has a failure below, what I am doing wrong?
./gradlew closeAndReleaseRepository

Configure project :

Task :closeRepository FAILED
GET request failed. 401: , body:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':closeRepository'.

401: , body:

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
1 actionable task: 1 executed

@szpak
Copy link
Member

szpak commented Jul 25, 2022

Are you sure, you have the credentials configured properly? Have you tried to re-run it with --info? It should display something like:

"Using username 'xxx' and password from repository 'yyy'"

If no, you can - temporarily - put your username and password/key directly in the build.gradle to check if it helps (just locally, do NOT commit it to GitHub!).

@softknife2021
Copy link
Author

image
yes it looks ok, have password and user set correctly. Not sure what I is wrong

@szpak
Copy link
Member

szpak commented Aug 7, 2022

You print some properties, but the closeRepository task doesn't print them on its own, so they might not be properly set in the plugin. Please paste the way how you configure gradle-nexus-staging-plugin, especially credentials.

@softknife2021
Copy link
Author

softknife2021 commented Oct 10, 2022 via email

@softknife2021
Copy link
Author

softknife2021 commented Oct 10, 2022 via email

@szpak
Copy link
Member

szpak commented Oct 13, 2022

plugins {
    ....
    id 'io.codearte.nexus-staging' version '0.30.0'
    ...
    id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
}

You mix two plugins doing (almost) the same. As mentioned in the README, io.github.gradle-nexus.publish-plugin is a successor of io.codearte.nexus-staging. In addition, you configure only the second plugin, but call tasks from the first one...

So, remove id 'io.codearte.nexus-staging' version '0.30.0' completely and try to call closeSonatypeStagingRepository (as suggested in the documentation - https://github.com/gradle-nexus/publish-plugin#behind-the-scenes .

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

2 participants