2

We have a multi module project for which we want to do a release using the following command

mvn release:prepare release:perform -B -e   -X

which fails with

07:54:12 [INFO] Caused by: org.eclipse.aether.transfer.ArtifactTransferException: 
 Could not transfer artifact ch.test.sub:my-app:pom:2019.02.07 from/to 
 release-repo (https://nexus.intra/content/repositories/releases/): 
Failed to transfer file: 
 https://nexus.intra/content/repositories/releases/ch/test/sub/my-app/2019.02.07/my-app-2019.02.07.pom. 
 The return code is 400, ReasonPhrase: Repository does not allow updating assets: releases.

The message is pretty clear but there are some things which do not add up

  1. When initiating maven the my-app-2019.02.07.pom is not in nexus
  2. I examined the log and there is only one "Uploading to release-repo" happening which is when the build process fails with the message above

    07:54:11 [INFO] [INFO] Uploading to release-repo: 
    https://nexus.intra/content/repositories/releases/ch/test/sub/my- 
    app/2019.02.07/my-app-2019.02.07.pom
    
  3. At this point, I can observe that there is a my-app-2019.02.07.pom in the Nexus repository

How does it get there when - according to the log - there was no upload happening?

pom.xml before maven is initiated

...
    <parent>
        <groupId>ch.test</groupId>
        <artifactId>my.app</artifactId>
        <version>2019.02.07-SNAPSHOT</version>
        <relativePath>../pom-parent</relativePath>
    </parent>
...

Version Info

  • Apache Maven 3.5.4
  • Java version: 1.8.0_201
  • OS name: "windows server 2016", version: "10.0", arch: "amd64", family: "windows"
Bilaal Rashid
  • 828
  • 2
  • 13
  • 21
papanito
  • 2,349
  • 2
  • 32
  • 60
  • See https://stackoverflow.com/questions/18649486/error-when-deploying-an-artifact-in-nexus/72223438 – Brad M May 13 '22 at 00:58

1 Answers1

0

I hit this issue and resolved by manually deleting the uploaded pom file, in my case it hit issues after the pom upload, causing the release to fail. Subsequent attempts at mvn release:perform then failed as that pom already existed. Another approach to fixing this is documented here Gradle Upload Fails But Still Deploys to Nexus

Mark
  • 21
  • 4