I see maven-dependency-plugin
does this; however, it seems to copy everything (including test jars) to the destination directory. Anyone know how to configure t
Mike answered their own question in a comment above. I think Mike's use case is similar to mine where I want to copy all of the jars I depend upon as well as my own jar in order to create a directory hierarchy sufficient to execute the program without including those dependencies directly into my own jar.
The answer to achieve this is:
compile
This directive goes into the section of the pom.xml for the maven-dependency plugin. For example:
org.apache.maven.plugins
maven-dependency-plugin
2.4
copy-dependencies
prepare-package
copy-dependencies
${project.build.directory}/lib
compile
excludeScope won't work because excluding test aborts the build and excludes all possible scopes. Instead the included scope needs to be adjusted.