I'm trying to copy all the dependencies of a project and its sub-modules to a specific folder (lets say parent/target/lib)
the project is something like this:
parent
|- module1
|- module2
|- module3
|- module3.1
|- module3.2
|- module4
in my understanding the only way to do so is by using maven copy-dependency in each sub-module as so:
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<outputDirectory>${parent.dir}/target/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<excludeGroupIds>xerces</excludeGroupIds>
<excludeArtifactIds>junit,testng,easymock</excludeArtifactIds>
</configuration>
</execution>
I'm having multiple issues with this however:
- the lib folder will contain all versions of an artifact (i want only latest)
- for each include/exclude rule all the poms need to be updated (there are a lot)
Isn't there something that works together with dependency:list to get all dependencies, keep the latest and copy them to my /lib folder?