Codearte / gradle-nexus-staging-plugin

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

closeAndReleaseRepository passes but the staging repository exists #147

Closed abhinayagarwal closed 4 years ago

abhinayagarwal commented 4 years ago

We use nexus-publish + nexus-staging to publish and release to Maven Central.

The Gradle command used for the same is as follows and it doesn't have a --info flag:

./gradlew publish closeAndReleaseRepository

We recently tried to release via Travis. Both closeRepository and releaseRepository tasks were successful. However, while executing releaseRepository, a warning was shown.

> Task :closeRepository

Requested operation was executed successfully in attempt 11 (maximum allowed 21)

> Task :releaseRepository

GET request failed. 404: Not Found, body: [errors:[[id:*, msg:No such repository: comgluonhq-1129]]]

Requested operation was executed successfully in attempt 7 (maximum allowed 21)

Irrespective of the tasks being successful, the repository was neither closed nor published. Also, what is the reason behind the GET request failed warning?

szpak commented 4 years ago

Irrespective of the tasks being successful, the repository was neither closed nor published.

That's extremely strange. Are you sure that the repository that stayed was comgluonhq-1129 (not any other)?

Also, what is the reason behind the GET request failed warning?

It's a side effect of the way the plugins checks if the repository was released (so effectively removed from Nexus). You can read more about that here.

Btw, I propose to add -i for the deployment tasks to make tracking potential issues easier.

abhinayagarwal commented 4 years ago

I will add the -i to the deployment task and come back with more information once we do the next release.

abhinayagarwal commented 4 years ago

Seems like this time both close and release were successful. Although, both these tasks were called before the actual closeAndReleaseRepository could be called.

Does publish automatically call these tasks?

szpak commented 4 years ago

Although, both these tasks were called before the actual closeAndReleaseRepository could be called.

It's ok. closeAndReleaseRepository is an umbrella task which depends on both closeRepository and releaseRepository. Just to make the call easier.

Does publish automatically call these tasks?

By default gradle-nexus-staging-plugin's tasks are publish independent. Can be called to close/release also previously created staging repository.

abhinayagarwal commented 4 years ago

It's ok. closeAndReleaseRepository is an umbrella task which depends on both closeRepository and releaseRepository

Things are now clear to me. Thank you for all the help.