Nexus "400 Repository does not allow updating assets" in CI
Nexus release repositories default to "Deployment policy: Disable redeploy". Deploying the same version twice returns 400 with "Repository does not allow updating assets". The artifact already exists.
What this error means
mvn deploy fails with "Received status code 400 (Bad Request)" and "Repository does not allow updating assets" for the release coordinates.
Nexus
[ERROR] Failed to deploy artifacts: Could not transfer artifact com.acme:app:jar:1.0.0
[ERROR] status code: 400, reason phrase: Repository does not allow updating assets: maven-releases (400)Common causes
Redeploying an existing release version
The release repo has redeploy disabled to keep releases immutable, so the second upload of the same version is rejected.
CI reran a release without a version bump
A retried pipeline deploys identical coordinates, colliding with the already-published asset.
How to fix it
Bump the release version
- Increment the version so coordinates are new.
- Deploy the new version to
maven-releases. - Send iterative builds to
maven-snapshotsinstead.
Terminal
mvn versions:set -DnewVersion=1.0.1
mvn deployUse the snapshot repository for non-releases
Snapshot repos allow redeploy; point -SNAPSHOT builds there and keep releases immutable.
pom.xml
<snapshotRepository>
<id>nexus</id>
<url>https://nexus.example.com/repository/maven-snapshots/</url>
</snapshotRepository>How to prevent it
- Never redeploy a release version; bump instead.
- Route snapshots to a redeploy-enabled snapshot repo.
- Keep release repos with redeploy disabled for immutability.
Related guides
Nexus "status code 401" bad credentials on deploy in CIFix Sonatype Nexus "Received status code 401 ... Unauthorized" on deploy in CI - the server settings credenti…
Artifactory "409 Conflict" cannot overwrite release in CIFix Artifactory "409 Conflict" when deploying to a release repository in CI - the repo forbids overwriting an…
OSSRH staging rules failure on close in CIFix OSSRH "Failed: ... staging rules failure" when closing a staging repository in CI - required metadata lik…