-
Notifications
You must be signed in to change notification settings - Fork 9
Setting stagingRepositoryId in nexus-staging-plugin #11
Comments
Since this plugin already checks for the presence of nexus-staging-plugin I think that would be a useful addition. Is there an issue with parallel publishing? |
nexus-staging-plugin currently has to look for one open staging repository, assuming that the one created by the current build. It makes the whole process fragile as there could be more release build from different projects using the same staging profile. In addition, in a case of failure, somewhere down the line, a repository can be left in an open state and it's required to do a manual clean up (as nexus-staging-plugin cannot distinguish which of those two repositories should be closed and releases). |
Understood. Let me know when you've published a version of the staging plugin that supports setting the id. I guess I'll have to use reflection to set it to stay compatible with older versions. |
I made required changes. In the plugin extension there is a Groovy property Would setting Regarding reflection concerns I propose to put the newer GNSP version as compileOnly/provided dependency and call the stagingRepositoryId getter in a try..catch block. On You can play with the snapshot (0.12.1-SNAPSHOT) version I've just uploaded (or Jitpack for branch devel). When confirmed it works fine on your side I will release the new version (once I fix the releasing issue with Travis as I use |
Thanks, sounds good to me! Not sure when I'll get to it, though. Do you have time to work on a PR? |
I took a look at the code and while just setting a value is trivial, putting it together is more complicated. You very nicely encapsulate internal details (such as |
I have no problem with uglifying foreign code, I made a PR with the needed changes. :-D |
Hi, @marcphilipp! 😉 |
Currently nexus-publish-plugin + nexus-staging-plugin works fine with Travis for one parallel publishing. To speed up the publishing process and make it more bullet proof the
closeRepository
task could take the (externally set) number instead of looking for one open repository (which always has been a workaround). As a fallback (if not set) it would be still be gathered the old way.Therefore, I could add
setStagingRepositoryId()
inCloseRepositoryTask
(probably in the super class which I plan to create) to hold that String value. It would be set by nexus-publish-plugin (taking into account that method is not available in the earlier plugin versions, which is quite odd). WDYT? Maybe there is now a better way in Gradle to set that kind of inter-task (or inter-plugin) dependencies/shared value to decrease coupling?The text was updated successfully, but these errors were encountered: