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

Still encountering "stagingRepositoryId is not provided" #158

Closed
io7m opened this issue Mar 11, 2020 · 9 comments
Closed

Still encountering "stagingRepositoryId is not provided" #158

io7m opened this issue Mar 11, 2020 · 9 comments

Comments

@io7m
Copy link

io7m commented Mar 11, 2020

Hello!

I'm trying to put together a simple testing project in an effort to give developers at the NYPL something they can use to run through the process of deploying to Maven Central (without needing to do a real deployment of a real app). The structure of the project matches that of the larger projects at the NYPL, but only contains a single module and very little code. Here's the project:

https://github.com/NYPL-Simplified/Maven-Central-Testing

I'm trying to bulletproof it, and part of that involves using the nexus-publish-plugin so that we know staging repository IDs explicitly instead of having the gradle-nexus-staging-plugin try to guess them. We have multiple developers pushing different projects to the same staging profile, and without having explicit staging repository IDs, the gradle-nexus-staging-plugin essentially breaks immediately (due to the documented and expected Wrong number of received repositories problem).

As far as I can make out, I've configured everything correctly in the project's build.gradle setup, and I'm applying both plugins so that, if the nexus-publish-plugin documentation can be believed, I should be using explicit staging repository IDs when I ./gradlew clean assemble publish closeAndReleaseRepository. Unfortunately, it appears that I'm not. I still see "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.".

What am I doing wrong? I've attached a log of a build that deployed and released on Central successfully, but I suspect that it would not have been successful had someone else been pushing something to the staging profile at the same time.

log.txt

@szpak
Copy link
Member

szpak commented Mar 11, 2020

Hello! I took a look at your build configuration and logs and it seems that nexus-publish-plugin (NPP) doesn't wrap your publish tasks with publishing to the implicitly created staging repository (and in fact doesn't create it at all). In that situation gradle-nexus-staging-plugin (GNSP) can only guess which repository should be closed (which seems to work as fallback).

@marcphilipp is it possible that Android uses some other kind of publishing (or it is configured in different way) which could not be detected by NPP?

@io7m
Copy link
Author

io7m commented Apr 13, 2020

'Ello.

This has actually become a bigger problem for us: The plugin appears to now be effectively unreliable enough in this configuration that we can almost never deploy to Central using it. I think this is probably interacting with the staging latency problems Central has been having lately.

@RoRoche
Copy link

RoRoche commented Apr 26, 2020

I do have the same warning message:

> Task :closeRepository
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.

@szpak
Copy link
Member

szpak commented Apr 26, 2020

@RoRoche Have you consulted the project FAQ?

@RoRoche
Copy link

RoRoche commented Apr 27, 2020

@RoRoche Have you consulted the project FAQ?

Yes, but I didn't find anything about this deprecation.

@szpak
Copy link
Member

szpak commented Apr 27, 2020

Please try this one. You might propose a PR with changes adding the 3rd point in FAQ with that exact warning message.

@RoRoche
Copy link

RoRoche commented May 4, 2020

I followed steps described in your blog post: https://solidsoft.wordpress.com/2019/02/22/reliable-releasing-to-maven-central-from-travis-using-gradle-2019-edition/

My configuration is here: https://github.com/RoRoche/elegant-android/blob/master/build.gradle
And here: https://github.com/RoRoche/elegant-android/blob/master/publish/publish_kotlin_library.gradle

But I'm still having:

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.
Requested operation was executed successfully in attempt 8 (maximum allowed 21)

Any idea of what I'm doing wrong?

@szpak
Copy link
Member

szpak commented May 5, 2020

Hmm,. I wonder if you don't need to apply plugin: "de.marcphilipp.nexus-publish" in the (sub)project you releasing. As opossed to my GNSP plugin which should be applied in the root project, NPP plays with the publications.

Btw, do you have a link to the CI server where the build takes place?

@szpak
Copy link
Member

szpak commented Feb 26, 2021

TL;TD. That problem should not exist in unified gradle-nexus-publish-plugin.

A longer version. To make releasing to Maven Central even easier, I and Marc Phillip (the author of nexus-publish-plugin) combined forces to create a next generation, unified, 2-in-1 plugin - gradle-nexus-publish-plugin. It is a recommended solution, as our development effort will be put in that new plugin. See my blog post and the official migration guide.

@szpak szpak closed this as completed Feb 26, 2021
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