maven-dependency-plugin : "useSubDirectoryPerArtifact" parameter not affected by "useBaseVersion" parameter

93 Views Asked by At

I'm trying to unpack some dependencies with maven-dependency-plugin.

I want each dependency in its own directory named with the artifact Id and the artifact version

For example :

  • target/unpacked/artifactA-1.0-SNAPSHOT-war/contentA
  • target/unpacked/artifactB-2.0-SNAPSHOT-ear/contentB

My execution is like that :

                            <execution>
                                <id>unpack-applications</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <includeArtifactIds>artifactA,artifactB</includeArtifactIds>
                                    <includeTypes>war,ear</includeTypes>
                                    <outputDirectory>target/unpacked</outputDirectory>
                                    <useSubDirectoryPerArtifact>true</useSubDirectoryPerArtifact>
                                    <useBaseVersion>true</useBaseVersion>
                              </configuration>
                            </execution>

But most of the time, i got :

  • target/unpacked/artifactA-1.0-timestampXXX-war/contentA
  • target/unpacked/artifactB-2.0-timestampXXX-ear/contentB

If I change the goal to copy-dependency, I obtain something like that :

  • target/unpacked/artifactA-1.0-timestampXXX-war/artifactA-1.0-SNAPSHOT.war
  • target/unpacked/artifactB-2.0-timestampXXX-ear/artifactB-2.0-SNAPSHOT.ear

So it appears that the useSubDirectoryPerArtifact is not affected by the useBaseVersion option, only the artifact itself is.

Is there a way to workaround this without unpacking the artifact manually ?

0

There are 0 best solutions below