Gradle uploadArchives runs in parallel causing multiple staging repositories on oss sonatype nexus

Viewed 151

I use this gradle uploadArchives to upload artefacts (jar, source code and javadoc) of an android open source library of mine to oss sonatype nexus repository. However, somehow uploadArchives seems to run in parallel because after completing gradle I see multiple staging repositories created on oss sonatype. One contains .jar, another one contains source code and java docs (or in any other combination like .jar and source code are in one staging repository but java docs are not in the same; it basically changes all the time).

Even disable parallel via ./gradlew uploadArchives -Dorg.gradle.parallel=false doesn't help.

I can't close/release a staging repository because it only contains some parts (like java docs and .jar but not source code) instead of all artefacts in one single staging repository (the rest is distributed to other staging repositories somehow).

Any idea how to solve this problem?

1 Answers

I do not know Your personal configuration of Gradle but I think the problem might be in an order of precedence when it comes to defining and processing Gradle properties.

Are You absolutely sure You do not have set org.gradle.parallel=true in Your project root gradle.properties? It is possible Your configuration prefers project root gradle.properties rather than explicitly passed via -D command line parameter.

I've had the same problem like You (uploadArchives caused creation of multiple staging repositories). Basically, getting rid of org.gradle.parallel=true from gradle.properties resolved all issues in my case.

Related