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

Incorrect behavior when publishing artifacts to (slow) Maven Central #15398

Closed
nehaev opened this issue Dec 2, 2020 · 3 comments
Closed

Incorrect behavior when publishing artifacts to (slow) Maven Central #15398

nehaev opened this issue Dec 2, 2020 · 3 comments
Labels
a:bug closed:not-fixed Indicates the issue was not fixed and is not planned to be in:publishing-plugins ivy-publish maven-publish

Comments

@nehaev
Copy link

nehaev commented Dec 2, 2020

Maven Central is quite often overloaded and responds slowly. Gradle can not handle this correctly even when publishing relatively small artifacts (700KB).

Current Behavior

Gradle console:

> Task :publishMavenJava8PublicationToMavenRepository FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':publishMavenJava8PublicationToMavenRepository'.
> Failed to publish publication 'mavenJava8' to repository 'maven'
   > Could not write to resource 'https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/loki4j/loki-logback-appender-jdk8/0.4.0/loki-logback-appender-jdk8-0.4.0.jar'.
      > Read timed out

On staging repositories page (https://oss.sonatype.org/#stagingRepositories) I see 2-3 new repos that contain only the artifact that Gradle failed to load, in my case: loki-logback-appender-jdk8-0.4.0.jar

Expected Behavior

  1. I should be able to set the timeout from my build configuration
  2. Retry behavior should be configurable from the build configuration and probably by default Gradle shouldn't retry publishing, as I don't expect to see multiple staging repos if I ran publish only once.

Your Environment

------------------------------------------------------------
Gradle 6.7
------------------------------------------------------------

Build time:   2020-10-14 16:13:12 UTC
Revision:     312ba9e0f4f8a02d01854d1ed743b79ed996dfd3

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          11.0.9.1 (Ubuntu 11.0.9.1+1-Ubuntu-0ubuntu1.18.04)
OS:           Linux 5.4.0-54-generic amd64
@ljacomet ljacomet added @jvm in:publishing-plugins ivy-publish maven-publish closed:not-fixed Indicates the issue was not fixed and is not planned to be labels Dec 2, 2020
@ljacomet
Copy link
Member

ljacomet commented Dec 7, 2020

Retries during publishing is problematic at different levels.
Here you are also using a staging repositories which can take some time to create on the repository side.
But you should be able to retry then.

This is an area that Gradle wants to improve but this not going to happen in the medium term. I will close this for now and it will be considered when working in this area.

@ljacomet ljacomet closed this as completed Dec 7, 2020
@nehaev
Copy link
Author

nehaev commented Dec 8, 2020

I will close this for now and it will be considered when working in this area.

Is there any workaround I can use until then?

@ljacomet
Copy link
Member

ljacomet commented Dec 8, 2020

There are plugins that allow to control the creation, closing and promotion of Nexus staging repositories. Using one of those helped me in the past to get the staging repo properly configured before attempting any upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug closed:not-fixed Indicates the issue was not fixed and is not planned to be in:publishing-plugins ivy-publish maven-publish
Projects
None yet
Development

No branches or pull requests

3 participants