Maven Dependency Plugin Not Using Parameters

314 views Asked by At

I am trying to use the maven-dependency-plugin to unpack-dependencies to a directory based on the artifact name.

To this end, I tried using the useSubDirectoryPerArtifact=true parameter but it appears that maven is not recognising this.

The exact command I am using is:

mvn -X dependency:unpack-dependencies -DincludeClassifiers=x86-win-vc80 -DoverWriteReleases=true -DoverWriteSnapshots=true -DuseSubDirectoryPerArtifact=true -DoutputDirectory=<OUTPUT_DIRECTORY>

When I view the debug output, I get something containing the following extract:

[DEBUG]   (f) silent = false
[DEBUG]   (s) skip = false
[DEBUG]   (f) stripClassifier = false
[DEBUG]   (s) stripVersion = false
[DEBUG]   (s) useJvmChmod = true
[DEBUG]   (s) useRepositoryLayout = false
[DEBUG]   (s) useSubDirectoryPerArtifact = false
[DEBUG]   (s) useSubDirectoryPerScope = false
[DEBUG]   (s) useSubDirectoryPerType = false
[DEBUG] -- end configuration --

Note that this behaviour is being exhibited by all of useSubDirectoryPerArtifact, useSubDirectoryPerScope and useSubDirectoryPerType, but that the other properties (such as the overwrites and the output directory) are being set correctly.

Is there something which I am doing incorrectly here, or is there another way to accomplish what I am trying to achieve?

TIA

1

There are 1 answers

0
mbamber On BEST ANSWER

I managed to solve this by changing useSubDirectoryPerArtifact=true to mdep.useSubDirectoryPerArtifact=true

The property to override is identified in the documentation here as user.property.

Note how this could be different (as it was in this case) to the name of the property.