title: Maven won't exclude during copy-dependencies
body: <p>I have a project that uses Netty 4.0.29 and I have another dependency that pulls in netty 3.9.0. I put in an exclusion but it is still roping in 3.9.0 when I run copy-dependencies.</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.ning&lt;/groupId&gt;
          &lt;artifactId&gt;async-http-client&lt;/artifactId&gt;
          &lt;version&gt;1.9.31&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;io.netty&lt;/groupId&gt;
                  &lt;artifactId&gt;netty&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>If I run mvn dependency:tree with this exclusion in place, I see that it is indeed excluded:</p>
  
  <pre><code>[INFO] +- com.ning:async-http-client:jar:1.9.31:compile
  </code></pre>
  
  <p>But when I run mvn clean dependency:copy-dependencies I see the jar 3.9.0 being copied along with the 4.0.29. According to the documentation and Google, this should not copy when there is an exclusion. </p>
  
  <pre><code>[INFO] Copying netty-3.9.0.Final.jar to /Users/udonom1/wk/141/coursecopy-api/target/dependency/netty-3.9.0.Final.jar
  [INFO] Copying netty-all-4.0.29.Final.jar to /Users/udonom1/wk/141/coursecopy-api/target/dependency/netty-all-4.0.29.Final.jar
  </code></pre>
  
  <p>I tried excluding as suggested by the first answer below and that did not work.</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy-dependencies&lt;/id&gt;
                      &lt;phase&gt;process-sources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy-dependencies&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;                               &lt;outputDirectory&gt;${project.build.directory}/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;excludeArtifactIds&gt;io.netty:netty:3.9.0.Final&lt;/excludeArtifactIds&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>I also added a dependency as further suggested: </p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;io.netty&lt;/groupId&gt;
          &lt;artifactId&gt;netty-all&lt;/artifactId&gt;
          &lt;version&gt;4.0.29.Final&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>