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

Multiple staging profiles created on upload by Gradle in Travis causes closeRepository task to fail #76

Closed
pavolloffay opened this issue Oct 15, 2018 · 3 comments

Comments

@pavolloffay
Copy link

pavolloffay commented Oct 15, 2018

Hi,

we are having issues to use this plugin when VM (travis) changes public IP during the release.

From https://help.sonatype.com/repomanager2/staging-releases/managing-staging-repositories

A separate staging repository is created for every combination of User ID, IP Address, and User Agent

This jira https://issues.sonatype.org/browse/OSSRH-19485?focusedCommentId=340094&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-340094 advices to use profile id.

We have added stagingProfileId to our gradle config however the build still fails e.g.
https://travis-ci.org/jaegertracing/jaeger-client-java/jobs/441639782#L775
and it still creates multiple staging repositories:
screenshot of nexus repository manager

Here is out gradle config https://github.com/jaegertracing/jaeger-client-java/blob/master/build.gradle#L87
and also https://github.com/jaegertracing/jaeger-client-java/blob/master/gradle/publish.gradle.

Any help is appreciated.

@szpak
Copy link
Member

szpak commented Oct 15, 2018

It's a big problem, I'm also not able to automatically release my project using Travis. In fact, it happens in the upload phase (multiple staging repositories are created) and closeRepository only visualize a problem. It affects also one-thread execution, even for a single module projects. I don't know how it could be solved at the gradle-nexus-staging-plugin level (merging staging repositories via API is not an option :) ).

Unfortunately Travis is unlikely to fix it on their side. There is an open issue for Gradle. You can comment there, as it seems to be a good place to fix it (it would be possible for gradle-nexus-staging-plugin to track one particular staging repository not to check number of them in a given state).

Update. I changed the title to more accurate.

@szpak szpak changed the title stagingProfileId creates multiple staging repositories and fails to close Multiple staging profiles created on upload causes closeRepository task to fail Oct 15, 2018
@szpak szpak changed the title Multiple staging profiles created on upload causes closeRepository task to fail Multiple staging profiles created on upload by Gradle plugin causes closeRepository task to fail Oct 15, 2018
@szpak szpak changed the title Multiple staging profiles created on upload by Gradle plugin causes closeRepository task to fail Multiple staging profiles created on upload by Gradle causes closeRepository task to fail Oct 15, 2018
@szpak szpak changed the title Multiple staging profiles created on upload by Gradle causes closeRepository task to fail Multiple staging profiles created on upload by Gradle in Travis causes closeRepository task to fail Oct 16, 2018
@szpak
Copy link
Member

szpak commented Oct 16, 2018

For desperate hearts, there is a workaround available by @jakubhava.

szpak added a commit that referenced this issue Nov 12, 2018
Internal implementation in the Exploratory E2E tests to verify it
with Travis.
szpak added a commit that referenced this issue Jan 2, 2019
To do not fail on GNSP close via HTTPS. The push url can be rewritten
locally to use SSH.
@szpak szpak added this to the 0.20.0 milestone Jan 2, 2019
szpak added a commit that referenced this issue Jan 2, 2019
szpak added a commit that referenced this issue Jan 3, 2019
The explicitly created repository can be used with uploadArchive tasks.
Created for internal use (no support) with Continuous Delivery Boy.
It's recommended to use "maven-publish" plugin with
"nexus-publish-plugin" to achieve the same in supported way.
szpak added a commit that referenced this issue Jan 5, 2019
@szpak
Copy link
Member

szpak commented Jan 5, 2019

It works fine with nexus-publish-plugin.

I updated the project FAQ to address it. A copy-paste for people hitting that issue.

To cut a long story short:

  • Gradle does not support uploading/publishing to explicitly created staging repositories in Nexus
  • gradle-nexus-staging-plugin had been using heuristics to find the right implicitly created staging repository in Nexus (which - with some limitations - worked fine in most cases)
  • Travis changed their infrastructure in autumn 2018 which resulted in using different IP addresses for the same build and - as a result - creation of multiple implicitly created staging repositories on upload/publishing for the same build
  • Marc Philipp created nexus-publish-plugin to enhance publishing in Gradle which seamlessly integrates with gradle-nexus-staging-plugin and "fixes" a problem

For releasing from Travis (and in general) it's recommended to add nexus-publish-plugin to your project and use its publishToNexus task to upload/publish artifacts to Nexus (instead of vanilla publish... from Gradle). It integrates seamlessly with gradle-nexus-staging-plugin to release to Maven Central (especially with 0.20.0+) - no other changes are required. What's more, with that enhancement implemented the releasing to Nexus will be even more reliable
(e.g. an ability to run multiple releases for the same staging profile).

However, there is one caveat. uploadArchives from the maven plugin is not supported by nexus-publish-plugin (only publish... from maven-publish).

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

2 participants