gradle-nexus-staging-plugin
gradle-nexus-staging-plugin copied to clipboard
Close all repositories
When running multiple, parallel builds, I often get errors such as:
Execution failed for task ':closeRepository'.
Wrong number of received repositories in state 'open'. Expected 1, received 4
It would be nice to have a way to force the closure of all four open repos.
In my opinion it would be dangerous. Image a situation that to some of those repositories are still being uploaded with artifacts. Closing too early would provide not fully complete release.
It would be best to be able to recognize the repository you uploaded artifacts to and close just that one. Unfortunately uploadArchives
task doesn't seem to provide necessary information. I'm not even sure if Nexus supports it.
As an another side effect it can be possible that two subsequent builds would upload two different versions to the same staging repository in the situation that closing the repository in the first build failed.
@mariuszs does maven-staging-plugin support identifying staging repositories by name?
@szpak, I agree that it could be dangerous, and such danger should be properly advised, but it is ultimately the user's responsibility to choose whether or not using a feature marked as dangerous.
I also agree that closing by name would be best.
If I'm not mistaken, the Nexus Staging Maven Plugin closes all open repositories by default. Implementing this feature, even by adding a configurable option for the user, would allow for a more seamless transition between the two plugins.
I 200% agree with @szpak here @Kjens93 BUT I have a better solution for you in issue #29
If that gets implemented, then you close repository with the staging id so it only closes that one that you care about. I ran into that error a lot myself and it was confusing.
I would like to have this too. Currently, I am publishing a multiplatform project with GitHub Actions. This project needs to use two machines, Windows and macOS. So I am getting two repositories. I would like to be able to have a flag for closing all repositories.
Exactly my same problem. Yet the task actually hang forever instead of erroring, which is kind of strange...