title: How do I exclude files/directories from the target directory using the maven war plugin?
body: <p>I followed the instructions <a href="http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html" rel="nofollow noreferrer">here</a>, and it worked but only if it was mapped to a directory other than the default.</p>
  
  <p>Here's a sample that I tried:</p>
  
  <pre><code>&lt;configuration&gt;
       &lt;webResources&gt;
            &lt;resource&gt;
                &lt;directory&gt;${basedir}/src/main/webapp/WEB-INF&lt;/directory&gt;
                &lt;!-- the below works when uncommented and does exclude *.tmp --&gt;
                &lt;!-- &lt;targetPath&gt;test/WEB-INF&lt;/targetPath&gt; --&gt;
                &lt;!-- the below does not --&gt;
                &lt;targetPath&gt;WEB-INF&lt;/targetPath&gt;
                &lt;excludes&gt;
                  &lt;exclude&gt;*.tmp&lt;/exclude&gt;
                &lt;/excludes&gt;
            &lt;/resource&gt;
        &lt;/webResources&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>So my assumptions is that I have something else overriding the configuration. However, this is my first project using maven, so I'm not sure what to test or investigate next.</p>