Maven deploy "409 Conflict" redeploying a release in CI
The release repository is configured to reject re-uploads of an existing release version. Maven tried to PUT a coordinate that already exists, and the server returned 409 Conflict to protect immutability.
What this error means
deploy fails with "Could not transfer artifact ... status code: 409, reason phrase: Conflict (409)" or "Repository does not allow updating assets". Snapshots deploy fine; only release redeploys are blocked.
[ERROR] Failed to deploy artifacts: Could not transfer artifact
com.example:app:jar:1.0.0 from/to nexus
(https://nexus.example.com/repository/maven-releases/):
status code: 409, reason phrase: Conflict (409) -> [Help 1]Common causes
Re-deploying a release version that already exists
Release repositories typically disable redeploy. Re-running the pipeline for the same fixed version conflicts with the artifact already published.
A non-SNAPSHOT version pushed twice
A release coordinate is immutable; the second upload of the same 1.0.0 is rejected with 409.
How to fix it
Bump the version instead of redeploying
- Increment to a new release version (or use a SNAPSHOT for iterative builds).
- Deploy the new coordinate, which does not exist yet.
- Never reuse a published release version.
mvn -B versions:set -DnewVersion=1.0.1
mvn -B deployDeploy SNAPSHOTs to the snapshot repository
Use a -SNAPSHOT version during development so redeploys overwrite cleanly in the snapshot repo.
<version>1.1.0-SNAPSHOT</version>How to prevent it
- Treat published release versions as immutable.
- Use SNAPSHOT versions for iterative CI deploys.
- Gate release deploys so the same version cannot be pushed twice.