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