title: Filter dependencies copied by Maven's copy-dependency?
body: <p>I need to essentially accomplish the following:</p>
  
  <ol>
  <li>Build my library into a JAR. (Easy, already done.)</li>
  <li>Copy my library's dependencies to a local folder, including the main project JAR, excluding dependencies marked as <code>provided</code>.</li>
  </ol>
  
  <p>I can't seem to get the second part finished. Is there a better way to do this than how I'm doing it below? I'm essentially deploying these JARs to a lib directory on a server. Unfortunately, the code below includes all JARs, even <code>provided</code> ones, but doesn't include the project output JAR. Should I be using a different plugin for this?</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;project&gt;
      ...
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.provided&lt;/groupId&gt;
              &lt;artifactId&gt;provided-lib&lt;/artifactId&gt;
              &lt;version&gt;1.2.3&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          ...
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &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;outputDirectory&gt;/hello&lt;/outputDirectory&gt;
                              &lt;excludeTransitive&gt;true&lt;/excludeTransitive&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>