gradle-release icon indicating copy to clipboard operation
gradle-release copied to clipboard

Multiple deployments to sonatype for the same repository

Open germanattanasio opened this issue 8 years ago • 11 comments

I use Travis to upload artifacts to a Nexus repository. Last week I tried to do a release and somehow and even that Travis looks ok.

Deploying application
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
	at build_1dfweaquewaruo334r91l4mq4$_run_closure10$_closure27.doCall(/home/travis/build/watson-developer-cloud/java-sdk/build.gradle:105)
:compileJava NO-SOURCE
:processResources NO-SOURCE
:classes UP-TO-DATE
:jar
:uploadArchives
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:jar UP-TO-DATE
:conversation:compileJava UP-TO-DATE
:conversation:processResources NO-SOURCE
:conversation:classes UP-TO-DATE
:conversation:jar UP-TO-DATE
:core:javadoc UP-TO-DATE
:conversation:javadoc UP-TO-DATE
:conversation:javadocJar UP-TO-DATE
:conversation:sourcesJar UP-TO-DATE
:conversation:signArchives
:conversation:uploadArchives
:core:javadocJar UP-TO-DATE
:core:sourcesJar UP-TO-DATE
:core:signArchives
:core:uploadArchives
:discovery:compileJava UP-TO-DATE
:discovery:processResources NO-SOURCE
:discovery:classes UP-TO-DATE
:discovery:jar UP-TO-DATE
:discovery:javadoc UP-TO-DATE
:discovery:javadocJar UP-TO-DATE
:discovery:sourcesJar UP-TO-DATE
:discovery:signArchives
:discovery:uploadArchives
:language-translator:compileJava UP-TO-DATE
:language-translator:processResources NO-SOURCE
:language-translator:classes UP-TO-DATE
:language-translator:jar UP-TO-DATE
:natural-language-classifier:compileJava UP-TO-DATE
:natural-language-classifier:processResources NO-SOURCE
:natural-language-classifier:classes UP-TO-DATE
:natural-language-classifier:jar UP-TO-DATE
:natural-language-understanding:compileJava UP-TO-DATE
:natural-language-understanding:processResources NO-SOURCE
:natural-language-understanding:classes UP-TO-DATE
:natural-language-understanding:jar UP-TO-DATE
:personality-insights:compileJava UP-TO-DATE
:personality-insights:processResources NO-SOURCE
:personality-insights:classes UP-TO-DATE
:personality-insights:jar UP-TO-DATE
:speech-to-text:compileJava UP-TO-DATE
:speech-to-text:processResources NO-SOURCE
:speech-to-text:classes UP-TO-DATE
:speech-to-text:jar UP-TO-DATE
:text-to-speech:compileJava UP-TO-DATE
:text-to-speech:processResources NO-SOURCE
:text-to-speech:classes UP-TO-DATE
:text-to-speech:jar UP-TO-DATE
:tone-analyzer:compileJava UP-TO-DATE
:tone-analyzer:processResources NO-SOURCE
:tone-analyzer:classes UP-TO-DATE
:tone-analyzer:jar UP-TO-DATE
:visual-recognition:compileJava UP-TO-DATE
:visual-recognition:processResources NO-SOURCE
:visual-recognition:classes UP-TO-DATE
:visual-recognition:jar UP-TO-DATE
:java-sdk:compileJava NO-SOURCE
:java-sdk:processResources NO-SOURCE
:java-sdk:classes UP-TO-DATE
:java-sdk:jar UP-TO-DATE
:language-translator:javadoc UP-TO-DATE
:natural-language-classifier:javadoc UP-TO-DATE
:natural-language-understanding:javadoc UP-TO-DATE
:personality-insights:javadoc UP-TO-DATE
:speech-to-text:javadoc UP-TO-DATE
:text-to-speech:javadoc UP-TO-DATE
:tone-analyzer:javadoc UP-TO-DATE
:visual-recognition:javadoc UP-TO-DATE
:java-sdk:javadoc NO-SOURCE
:java-sdk:javadocJar UP-TO-DATE
:java-sdk:shadowJar UP-TO-DATE
:java-sdk:sourcesJar UP-TO-DATE
:java-sdk:signArchives
:java-sdk:uploadArchives
:language-translator:javadocJar UP-TO-DATE
:language-translator:sourcesJar UP-TO-DATE
:language-translator:signArchives
:language-translator:uploadArchives
:natural-language-classifier:javadocJar UP-TO-DATE
:natural-language-classifier:sourcesJar UP-TO-DATE
:natural-language-classifier:signArchives
:natural-language-classifier:uploadArchives
:natural-language-understanding:javadocJar UP-TO-DATE
:natural-language-understanding:sourcesJar UP-TO-DATE
:natural-language-understanding:signArchives
:natural-language-understanding:uploadArchives
:personality-insights:javadocJar UP-TO-DATE
:personality-insights:sourcesJar UP-TO-DATE
:personality-insights:signArchives
:personality-insights:uploadArchives
:speech-to-text:javadocJar UP-TO-DATE
:speech-to-text:sourcesJar UP-TO-DATE
:speech-to-text:signArchives
:speech-to-text:uploadArchives
:text-to-speech:javadocJar UP-TO-DATE
:text-to-speech:sourcesJar UP-TO-DATE
:text-to-speech:signArchives
:text-to-speech:uploadArchives
:tone-analyzer:javadocJar UP-TO-DATE
:tone-analyzer:sourcesJar UP-TO-DATE
:tone-analyzer:signArchives
:tone-analyzer:uploadArchives
:visual-recognition:javadocJar UP-TO-DATE
:visual-recognition:sourcesJar UP-TO-DATE
:visual-recognition:signArchives
:visual-recognition:uploadArchives

See: Travis log

I see multiple deployments in sonatype.

For some of them the javadocs or the metadata is missing.

screen shot 2018-03-11 at 11 14 55 pm

Why is the plugin using multiple repository deployments instead of just one like it always did?

Please let me know if you need more information. BTW: This library is awesome

germanattanasio avatar Mar 12 '18 03:03 germanattanasio

I've seen similar issues posted to the Sonatype issues board and it seems to have something to do with changing IP addresses during the release process creating multiple staging repositories.

See:

  • https://issues.sonatype.org/browse/OSSRH-37302?jql=project%20%3D%20OSSRH%20AND%20status%20%3D%20Open%20AND%20text%20~%20%22split%22
  • https://issues.sonatype.org/browse/OSSRH-5454
  • https://issues.sonatype.org/browse/OSSRH-19485
  • https://issues.sonatype.org/browse/OSSRH-6262?jql=project%20%3D%20OSSRH%20AND%20status%20%3D%20Open%20AND%20text%20~%20%22split%22

The solution seems to be using a release tool that allows you to specify your profile ID. Unfortunately, the recommended tools use Maven, and I haven't been able to find a Gradle alternative. Would it be feasible to add this option to the gradle-release tool? I would be happy to try and write a PR.

lpatino10 avatar Mar 12 '18 16:03 lpatino10

From what I see it's not directly related to the release plugin. The problem is the gradle internal on uploading the artifacts as it is done in multiple requests and if they use different outbound ip adresses the nexus is splitting these artifacts up. If I got it right from the issues you posted it can be fixed by using a stagingProfileId with the https://github.com/Codearte/gradle-nexus-staging-plugin/ Connecting this to the release tasks should fix it.

Hillkorn avatar Mar 13 '18 16:03 Hillkorn

@Hillkorn can we add stagingProfileId to the upload so that nexus doesn't use the ip address?

germanattanasio avatar Mar 13 '18 17:03 germanattanasio

I would try out the gradle plugin is posted the link for. The issue is not the release plugin but the upload that is done in multiple steps + you uploaded the artifacts under different IPs

Hillkorn avatar Mar 13 '18 19:03 Hillkorn

Did anybody solve this? We have the same issue

pavolloffay avatar Apr 11 '18 14:04 pavolloffay

@pavolloffay We are doing the releases manually for now. I still think we can do send the stagingProfileId during the uploadArchives. I really like this plugin, let's brainstorm possible solutions and I will create a PR

germanattanasio avatar Apr 11 '18 15:04 germanattanasio

@germanattanasio Have you been able to tweak uploadArchives to consider the stagingProfileId value (or at least check it is not possible and report a feature request in Gradle)?

szpak avatar Sep 25 '18 20:09 szpak

@Hillkorn Is there an (open) Travis issue related to using different different IP address? I believe I' ve read it then, but it's not linked here and I cannot find it anymore. If not, maybe it would be good to ask Travis guys about that? I assume the problem is in the same Travis build, only in different upload tasks (due to having multiple modules), right?

szpak avatar Sep 25 '18 20:09 szpak

As I remember the issues was that the ip address changed during the upload of the artifacts. Have you tried the gradle-nexus-staging-plugin together with maven-publish? With this plugin you can open and close a repository to tell it when your'e done with your upload of artifacts https://github.com/Codearte/gradle-nexus-staging-plugin/

Hillkorn avatar Sep 26 '18 07:09 Hillkorn

@szpak here is an issue reported in travis-ci https://github.com/travis-ci/travis-ci/issues/9555

pavolloffay avatar Oct 15 '18 14:10 pavolloffay

Thanks @pavolloffay . I have found it in the meantime :).

Just for a reference, this issue is tracked in gradle-nexus-staging-plugin as https://github.com/Codearte/gradle-nexus-staging-plugin/issues/76

szpak avatar Oct 15 '18 15:10 szpak