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

Question: Publish and Closing in a Different Step #134

Open
musketyr opened this issue Dec 13, 2021 · 4 comments
Open

Question: Publish and Closing in a Different Step #134

musketyr opened this issue Dec 13, 2021 · 4 comments

Comments

@musketyr
Copy link

Hi,

I would like to publish my libraries in a different steps because I use a different inputs for these

  1. publish with version 1.2.3-suffix-1 (publishToSonatype -Pversion=1.2.3-suffix-1)
  2. publish with version 1.2.3-suffix-2 (publishToSonatype -Pversion=1.2.3-suffix-1)
  3. close and release staging repositories (closeAndReleaseSonatypeStagingRepository)

Is this possible to achieve somehow. The closeAndReleaseSonatypeStagingRepository takes a very long time so I would to avoid calling it multiple times.

@paullatzelsperger
Copy link

I have a similar situation, where we have multiple projects under the same groupId, each of which is built and published in its own Jenkins Job, something like this:

  • Project 1 contains my.fancy.groupid:some-artifact and my.fancy.groupid:some-other-artifact
  • Project 2 contains my.fancy.groupid:whatever-artifact
  • Project 3 contains my.fancy.groupid:foobar-artifact

I want to release all the artifacts at the same time, with the same version number, but in different build steps. Can this be done? I.e. is this possible:

  • project 1 publishToSonatype (should create the staging repo)
  • project 2 publishToSonatype
  • project 3 publishToSonatype
  • closeAndReleaseSonatypeStagingRepository

Any help is greatly appreciated.

@vlsi
Copy link
Contributor

vlsi commented Sep 14, 2022

I believe #145 adds a foundation for the feature.
In other words, firstly you coould create a staging repo (e.g. when publishing the first project), then you use findStagingRepo task to find the repo.

@paullatzelsperger
Copy link

@vlsi thanks for the quick reply. So you're saying I could do this:

  • ./gradlew publishToSonatype
  • ./gradlew findStagingRepo publishToSonatype
  • ./gradlew closeAndReleaseStagingRepository

@vlsi
Copy link
Contributor

vlsi commented Sep 14, 2022

I guess so.
The thing is if publish and close need to be split into two different executions, then the "close" part should somehow get the staging repository id.
I incline that specifying the id manually is prone to errors, so it would be much better if the plugin could find the corresponding id by searching for a user-defined id (e.g. project version).

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

3 participants