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

Trouble closing and releasing a library with the plugin #87

Closed
TheOnlyTails opened this issue Apr 8, 2021 · 11 comments
Closed

Trouble closing and releasing a library with the plugin #87

TheOnlyTails opened this issue Apr 8, 2021 · 11 comments

Comments

@TheOnlyTails
Copy link

When I after I publish my library to Nexus (using publishAllPublicationsToSonatypeRepository) and try to close the repo and release it using either closeAndReleaseSonatypeStagingRepository, closeAndReleaseStagingRepository, or closeSonatypeStagingRepository + releaseSonatypeStagingRepository, I always get this error:

No staging repository with name sonatype created

What could be the cause of this?
Thanks so much!

I'm using version 1.0.0 of the plugin, and this is my build.gradle.kts: https://gist.github.com/2dd5c1ef88fe5d1205e7c4954dbbb1a3

@szpak
Copy link
Contributor

szpak commented Apr 8, 2021

No staging repository with name sonatype created

Is it a Gradle error or a body of the Nexus server response?

Do you see any staging repositories when logged into https://s01.oss.sonatype.org/ after the publish... command?

Please paste (here or via Gist) publishing-related parts of the log at the info level (--info) to give us more insight into the case.

Update. I changed the URL to Nexus - as you use s01..

@TheOnlyTails
Copy link
Author

Is it a Gradle error or a body of the Nexus server response?

This is a Gradle error, and it appears in the Gradle log.

Do you see any staging repositories when logged into https://s01.oss.sonatype.org/ after the publish... command?

Yes, I do. Closing them manually does work fine.

Here are the publishing related parts of the Gradle log: https://gist.github.com/TheOnlyTails/232b974808594b7ff4553b346bfd58fa

@szpak
Copy link
Contributor

szpak commented Apr 8, 2021

Thanks. s01. is a new service and we perform our e2e tests with the old instance. There might be some issue with a place where we try to initialize and close/release a staging repository. Please rerun it with --info -s and paste also a part with the staging repository initialization task and maybe with the publishing part.

The error suggests that the plugin has a problem with finding the initialized staging repository it should create before the artifacts upload.

@TheOnlyTails
Copy link
Author

@szpak
Copy link
Contributor

szpak commented Apr 8, 2021

Thanks. It sheds light on the problem. I should confirm that, but from your original I understood that you do everything in the same Gradle call. Your last log suggests that it is not a case. Until #19 is implemented, please call ./gradle publishAllPublicationsToSonatypeRepository closeAndReleaseSonatypeStagingRepository to perform the release. Then the staging repository is initialized (is explicitly created), artifacts are published to that particular repository and it is close/released. It should help.

Btw, if you prefer to inspect the staging repository before the release, please call closeSonatypeStagingRepository instead of closeAndReleaseSonatypeStagingRepository. After an inspection, you can call just releaseSonatypeStagingRepository passing stagingRepositoryId as a command line parameter.

@TheOnlyTails
Copy link
Author

Great. I'll go to sleep for now and try tomorrow.

@TheOnlyTails
Copy link
Author

Looks like that's working, thanks!

@TheOnlyTails
Copy link
Author

I also believe I've found the problem: I was using a sonatype block in the nexusPublishing function, instead of using create("loottables") (loottables is my artifact ID).

@szpak
Copy link
Contributor

szpak commented Apr 9, 2021

sonatype should be fine. It defines a publishing repository (name) which you use in publishToNAME* tasks.

@TheOnlyTails
Copy link
Author

Yes, my bad.

@szpak
Copy link
Contributor

szpak commented Apr 9, 2021

Looks like that's working, thanks!

Glad it hear, closing.

@szpak szpak closed this as completed Apr 9, 2021
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