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

Ability to set stagingRepositoryId by external plugin #77

Closed
szpak opened this issue Jan 2, 2019 · 14 comments
Closed

Ability to set stagingRepositoryId by external plugin #77

szpak opened this issue Jan 2, 2019 · 14 comments
Milestone

Comments

@szpak
Copy link
Member

szpak commented Jan 2, 2019

nexus-publish-plugin enhances the Gradle publishing mechanism to explicitly create a staging repository. It improves reliability of the release process (see #76 among others).
It would be handy to provide a mechanism to provide the explicitly created repository id by some other plugin instead of trying to determine one looking for its state. It's needed for marcphilipp/nexus-publish-plugin#11.

@szpak szpak added this to the 0.13.0 milestone Jan 2, 2019
szpak added a commit that referenced this issue Jan 2, 2019
E.g. by some external plugin which created it explicitly.
@szpak
Copy link
Member Author

szpak commented Jan 5, 2019

Implemented on the gradle-nexus-staging-plugin side via stagingRepositoryId in the plugin extension class.

@szpak szpak closed this as completed Jan 5, 2019
@ihostage
Copy link

Hi, @szpak!
Can you share the example of build configuration for using stagingRepositoryId?

@szpak
Copy link
Member Author

szpak commented Jan 30, 2019

Do you want to set it manually or plan to use https://github.com/marcphilipp/nexus-publish-plugin ?

@ihostage
Copy link

I try to use gradle-nexus-staging-plugin + nexus-publish-plugin. But now I have two problems:

  • ./gradlew publishToNexus create two repositories (one implicitly + one explicitly)
  • I don't know, how right to use stagingRepositoryId

@ihostage
Copy link

ihostage commented Jan 30, 2019

My configuration is next:

  • root project:
plugins {
    id("io.codearte.nexus-staging") version "0.20.0"
}
...
nexusStaging {
    packageGroup = "org.taymyr"
    username = ossrhUsername
    password = ossrhPassword
}
  • child project:
plugins {
    id("de.marcphilipp.nexus-publish") version "0.1.1"
}
...
nexusPublishing {
    packageGroup.set("org.taymyr")
    username.set(ossrhUsername)
    password.set(ossrhPassword)
}

@szpak
Copy link
Member Author

szpak commented Jan 30, 2019

You need to wait for marcphilipp/nexus-publish-plugin#11 to be merged and releases. Alternatively you could try to get value (somehow) from nexus-publish-plugin internals and set it in gradle-nexus-staging-plugin's extension with (something like):

NexusStagingExtension nexusStagingExtension = 
    project.getRootProject().getExtensions().getByType(NexusStagingExtension.class);
nexusStagingExtension.stagingRepositoryId.set(stagingRepositoryIdFetchSomehowFromNexusPublishPlugin)

@szpak
Copy link
Member Author

szpak commented Jan 30, 2019

Btw, settings credentials in nexusPublishing {} should not be necessary (unless to resolve it in afterEvaluation {}). See this code.

@ihostage
Copy link

Thanks, @szpak! 👍
After marcphilipp/nexus-publish-plugin#11 to be merged, stagingRepositoryId will be set implicitly?
Will not I need to change the build script and just upgrade version of plugin?

@szpak
Copy link
Member Author

szpak commented Jan 30, 2019

Just the upgrade of nexus-publish-plugin should be enough (as you already have 0.20.0 of GNSP).

You may also send a friendly ping in marcphilipp/nexus-publish-plugin#11 :)

@ihostage
Copy link

Already 😂 I link PR for our repository taymyr/lagom-extensions#4 with this issue 😄

@io7m
Copy link

io7m commented Feb 27, 2020

Quick question: If you're not yet using the nexus-publish-plugin, you obviously get this deprecation warning:

DEPRECATION WARNING. The staging repository ID is not provided. The fallback mode may impact release reliability and is deprecated. Please consult the project FAQ how it can be fixed.

Possibly silly question, but does this mean that at some point the gradle-nexus-staging-plugin will become impossible to use without the nexus-publish-plugin? I'm guessing the answer to that question is no, and therefore this means you might implement the explicit staging repository creation directly?

I'm hesitant to pull yet another plugin into the build just to do something I can do in Maven builds without plugins.

@szpak
Copy link
Member Author

szpak commented Feb 27, 2020

@io7m, I don't plan to disable "the fallback mode".

As good news, together with @marcphilipp we decided to give the next generation releasing plugin a try - https://github.com/gradle-nexus/publish-plugin/ . Once ready, I will be a replacement for both GNSP and NPP.

@szpak
Copy link
Member Author

szpak commented Feb 27, 2020

Btw, unless it changed recently, in the Maven builds you also need a separate plugin, just created by the same people as Sonatype Nexus :-).

@io7m
Copy link

io7m commented Feb 27, 2020

Nice! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants