Skip to content
Latchkey

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

  1. Increment the version so coordinates are new.
  2. Deploy the new version to maven-releases.
  3. Send iterative builds to maven-snapshots instead.
Terminal
mvn versions:set -DnewVersion=1.0.1
mvn deploy

Use 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →