Bertrand Renuart created MDEP-590: ------------------------------------- Summary: dependency:copy confused when instructed to copy artifact with classifier and extension .POM Key: MDEP-590 URL: https://issues.apache.org/jira/browse/MDEP-590 Project: Maven Dependency Plugin Issue Type: Bug Affects Versions: 3.0.2, 3.0.1, 3.0.0 Reporter: Bertrand Renuart
Suppose you ask the maven-dependency-plugin to copy an artifact with the following coordinates: - groupId: _group_ - artifactId: _artifact_ - version: _1.0-SNAPSHOT_ - classifier: _custom_ - type: _pom_ This is done with the following configuration: {code} <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.0.2</version> <executions> <execution> <phase>generate-resources</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>group</groupId> <artifactId>artifact</artifactId> <version>1.0-SNAPSHOT</version> <classifier>custom</classifier> <type>pom</type> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> {code} The MOJO will fail to copy the artifact with the {{custom}} classifier but will instead copy the primary .POM artifact. However, things are ok if _type_ is set to _xml_ instead of _pom_. It seems the mojo totally ignores the classifier whenever the type is _pom_... I have attached a sample project made of two modules to reproduce the issue. The first module has an additional artifact of type _pom_ and classifier _custom_ attached to it via the _build-helper-maven-plugin_ The second module attempts to copy that additional artifact with the maven-dependency-plugin. Run it with {{mvn package}}. The result of the copy is in {{module-b/target/copied-custom.pom}}. It is ecpected this file is a copy of {{module-a/custom.xml}} but is actually a copy of the primary pom, ie {{module-a/pom.xml}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)