Jürgen created MDEP-870: --------------------------- Summary: artifact pom not overwritten Key: MDEP-870 URL: https://issues.apache.org/jira/browse/MDEP-870 Project: Maven Dependency Plugin Issue Type: Bug Affects Versions: 3.3.0 Reporter: Jürgen
the situation: copy-dependencies, copyPom true, stripVersion true no clean of target directory beforehand the artifact jar + associated pom already in target directory (with different artifact version due to project branch switch) ./artifact.jar (1.0.0) ./artifact.pom (1.0.0) what happens, copy-dependencies will copy the new artifact.jar to target directory, but not copy the associated pom, leaving the old (for a different version) pom ./artifact.jar (2.0.0, 1.0.0 was overwritten) ./artifact.pom (1.0.0, not overwritten!) my gut feeling is, that {code:java} CopyDependenciesMojo.copyPoms() { ... if (!pomDestFile.exists()) copyFile ... }{code} is the wrong check. the pom should be copied/overwritten, if it's artifact was copied/overwritten. cf. [https://github.com/apache/maven-dependency-plugin/blob/e52bc0248c00dbf5458a0ce080db260148dab4b9/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java#L286] same is true for current 3.6.0 -- This message was sent by Atlassian Jira (v8.20.10#820010)