title: How to exclude files from being copied, by maven, into the exploded war
body: <p>I have a Java web app, in which I have some folders within the standard webapp source directory <code>(src/main/webapp)</code> that I don't want to get copied over into the war (<code>exploded</code> or <code>packaged</code>).</p>
  
  <p>One of the reasons I don't want these files copying over is that we run the YUI JS &amp; CSS minimizer &amp; compressor on .js and .css files within the exploded war. The files that I want to exclude produce errors during the compression phase. The other reason I don't want them adding to the war is that they support testing a single page JS app that lives within the webapp (they are client side JS test scripts that rely on <code>node</code> / <code>angular.js</code>).</p>
  
  <p>Below are the relevant sections from the <code>POM.xml</code>:</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
    &lt;version&gt;2.1.1&lt;/version&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;id&gt;parent-resources&lt;/id&gt;
        &lt;configuration&gt;
          &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
          &lt;overlays&gt;
          &lt;/overlays&gt;
          &lt;webappDirectory&gt;${project.build.directory}/${project.build.finalName}-work&lt;/webappDirectory&gt;
        &lt;/configuration&gt;
        &lt;phase&gt;generate-sources&lt;/phase&gt;
        &lt;goals&gt;
          &lt;goal&gt;exploded&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I have tried, unsuccessfully, to use <code>warSourceExcludes</code> to exclude certain paths, but to no avail. An example of my usage is shown below, where <code>client/</code> is a folder directly beneath <code>src/main/webapp</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;configuration&gt;
    ...
    &lt;warSourceExcludes&gt;
      &lt;excludes&gt;
        &lt;exclude&gt;
          client/
        &lt;/exclude&gt;
      &lt;/excludes&gt;
    &lt;/warSourceExcludes&gt;
    ...
  &lt;/configuration&gt;
  </code></pre>
  
  <p>What is the correct way to exclude certain paths, and or individual files, within the web app source directory from being included in the exploded war?</p>
  
  <h1>UPDATE</h1>
  
  <p>Following on from the suggestion from @maba I updated the configuration as follows:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;configuration&gt;
    &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
    &lt;overlays&gt;
    &lt;/overlays&gt;                                 
    &lt;webappDirectory&gt;${project.build.directory}/${project.build.finalName}-work&lt;/webappDirectory&gt;
    &lt;warSourceExcludes&gt;client/&lt;/warSourceExcludes&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The folder, <code>client/</code>, still is getting copied across. Any ideas?</p>