Question

I try to upload my project artifacts to nexus staging.

The upload starts with uploading two artifacts in parallel, after that every arttifact is uploaded one after another:

[...]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ tkscommons ---
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/myproject/myproject-0.1.2.jar
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/myprojekt/myprojekt-0.1.2.pom
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/myprojekt/myprojekt-0.1.2.pom (4 KB at 0.6 KB/sec)
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/myprojekt/myprojekt.jar (12 KB at 1.7 KB/sec)
Downloading: https://oss.sonatype.org/service/local/staging/deploy/maven2/de/thksystems/myprojekt/maven-metadata.xml
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/de/thksystems/myprojekt/maven-metadata.xml
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/de/thksystems/myprojekt/maven-metadata.xml (303 B at 0.2 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/myprojekt/myprojekt-sources.jar
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/myprojekt/myprojekt-sources.jar (8 KB at 2.7 KB/sec)
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/myprojekt/myprojekt-javadoc.jar
Uploaded: https://oss.sonatype.org/service/local/staging/deploy/maven2/myprojekt/myprojekt-javadoc.jar (91 KB at 24.4 KB/sec)
[...]

How can I stop that parallal upload? How is it caused?


UPDATE (2014/05/02): The problem only occured, if I start deploying within eclipse (m2e). If I start it from the command line, it works fine and no upload is parallized.

Was it helpful?

Solution 2

The problem is caused by m2eclipse. Deploying using maven from comandline works well, though this is my solution.

OTHER TIPS

Try configuring your build to deploy using the nexus-staging-maven-plugin:

http://books.sonatype.com/nexus-book/reference/staging-sect-deployment.html

I have been struggling to figure out why I can't get an artifact to deploy to Nexus 3 and this topic nailed it!

Below you can see the output of a deploy using embedded maven M2elipse. The Jar and POM upload in parallel. The pom succeeds but the jar fails to upload and it returns code "401 Unauthorized". When I look in Nexus I can see the pom but not the jar.

[INFO] --- maven-deploy-plugin:3.0.0:deploy (default-deploy) @ xxx-project ---
[INFO] Uploading to : https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2.jar
[INFO] Uploading to : https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2.pom
[INFO] Uploaded to : https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2.pom (13 kB at 36 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.527 s
[INFO] Finished at: 2022-11-04T08:38:47-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.0:deploy (default-deploy) on project ***-project: Failed to deploy artifacts: Could not transfer artifact com.***:***-project:jar:7.1.8.2 from/to ***-nexus (https://nexus.***.com/repository/releases/): Access denied to https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2.jar. Error code 401, Unauthorized -> [Help 1]

The log below shows a successful deploy made from a a command line maven.

[INFO] --- maven-deploy-plugin:3.0.0:deploy (default-deploy) @ ***-project ---
Uploading to ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2.pom
Uploaded to ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2.pom (6.4 kB at 12 kB/s)
Uploading to ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2.jar
Uploaded to ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2.jar (22 kB at 77 kB/s)
Uploading to ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2-tests.jar
Uploaded to ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/7.1.8.2/***-project-7.1.8.2-tests.jar (8.0 kB at 29 kB/s)
Downloading from ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/maven-metadata.xml
Downloaded from ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/maven-metadata.xml (371 B at 3.1 kB/s)
Uploading to ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/maven-metadata.xml
Uploaded to ***-nexus: https://nexus.***.com/repository/releases/com/***/***-project/maven-metadata.xml (371 B at 1.4 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.860 s
[INFO] Finished at: 2022-11-04T08:54:29-05:00
[INFO] ------------------------------------------------------------------------

In summary it seems that Nexus does not like parallel deployment and if you attempt this it will return error 401. For this reason deployment from M2Eclipse is broken.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top