gradle-nexus-staging-plugin icon indicating copy to clipboard operation
gradle-nexus-staging-plugin copied to clipboard

Close all repositories

Open DanySK opened this issue 7 years ago • 6 comments

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.

DanySK avatar Oct 06 '16 14:10 DanySK

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 avatar Oct 06 '16 15:10 szpak

@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.

DanySK avatar Oct 10 '16 10:10 DanySK

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.

kylerjensen avatar Dec 23 '16 17:12 kylerjensen

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.

deanhiller avatar Dec 23 '16 19:12 deanhiller

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.

JavierSegoviaCordoba avatar Jan 29 '21 18:01 JavierSegoviaCordoba

Exactly my same problem. Yet the task actually hang forever instead of erroring, which is kind of strange...

lamba92 avatar Feb 06 '21 01:02 lamba92