title: How to exclude certain resources from the maven war plugin war file?
body: <p>We've been using <code>war:exploded</code> for a while now and I'm trying to do away with it.  I've added the following to my pom:</p>
  
  <pre><code>&lt;resource&gt;
      &lt;directory&gt;src/main/webapp&lt;/directory&gt;
  &lt;/resource&gt;
  </code></pre>
  
  <p>This copies files such as the in <code>src/main/webapp/keystore</code> into <code>target/classes/keystore</code> so my local UI launcher works and sees everything.  Score!</p>
  
  <p>However, by adding to the resources list, this means that the same files also show up in the <code>war</code> file as <code>keystore</code> (correct) <em>and</em> <code>WEB-INF/classes/keystore</code> (wrong).  It also means there there is a <code>WEB-INF/classes/WEB-INF</code> directory (blah).  I'm trying to exclude the resource files from <code>src/main/webapp</code> resource since <code>src/main/webapp/WEB-INF</code> is already a resource.</p>
  
  <p>I'm trying not to specifically exclude <code>keystore</code> and other files since we add/delete from that list semi-often.  I've tried to add the following (and a number of other variants) to the war plugin configuration without results:</p>
  
  <pre><code>&lt;webResources&gt;
     &lt;resource&gt;
        &lt;directory&gt;src/main/webapp&lt;/directory&gt;
        &lt;excludes&gt;
           &lt;exclude&gt;**&lt;/exclude&gt;
        &lt;/excludes&gt;
     &lt;/resource&gt;
  &lt;/webResources&gt;
  </code></pre>
  
  <p>I've also read a number of other SO questions and I've spent at least an hour reading docs on from the <a href="http://maven.apache.org/plugins/maven-war-plugin/" rel="noreferrer">maven war plugin page</a> and tried other configs without success.</p>
  
  <p>Any idea what magic I need to do here?  Thanks in advance.</p>