Affects Version/s: 3.2.1
Fix Version/s: None
When updating the pom version and deploying the updated pom to Artifactory we get the following error:
Caused by: java.io.IOException: Failed to deploy file. Status code: 409 Response message: Artifactory returned the following errors:
The target deployment path 'groupId/artifactId/70.1.4
SNAPSHOT/artifactId70.1.4-SNAPSHOT.pom' does not match the POM's expected path prefix 'artifactId/70.1.1-SNAPSHOT'. Please verify your POM content for correctness and make sure the source path is a valid Maven repository root path. Status code: 409
What seems to be happening is:
- The Artifactory plugin gets the version from the pom.xml when the build is triggered
- The version is updated using mvn versions:set ...
- The Artifactory plugin tries to deploy the updated pom to a path which contains the old version
- Since the version in the path and pom don't match, Artifactory blocks the deployment.
What should be done is that the plugin fetches the new version from the pom prior to determining the path and uploading to Artifactory.
We've seen this happening after updating the Token Macro plugin from v2.6 to v2.10. It looks like this update caused some issues for the maven plugin which is using this as an optional dependency. The Artifactory plugin has a dependency on the Maven plugin, hence it's impacted.