Filtering in maven-war-plugin does not exclude directory <p>This is a followup of my yesterday question <a href="http://stackoverflow.com/questions/23082104/conditionally-exclude-some-resources-in-maven-from-war">Conditionally exclude some resources in maven from war</a>. I was able to rearrange both development and production wars but filtering copies a directory <code>properties</code> to the war though it shall be excluded according to <a href="https://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html" rel="nofollow">documentation</a>. I could use <code>packagingExcludes</code> option, but I wonder why <code>excludes</code> does not work. Thank you for explanation.</p> <pre><code>&lt;plugin&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;classifier&gt;dev&lt;/classifier&gt; &lt;webappDirectory&gt;${project.build.directory}/${project.build.finalName}-dev&lt;/webappDirectory&gt; &lt;filters&gt; &lt;filter&gt;${project.basedir}/configurations/properties/config_dev.prop&lt;/filter&gt; &lt;/filters&gt; &lt;webResources&gt; &lt;resource&gt; &lt;directory&gt;configurations&lt;/directory&gt; &lt;filtering&gt;true&lt;/filtering&gt; &lt;targetPath&gt;WEB-INF/classes&lt;/targetPath&gt; &lt;excludes&gt; &lt;exclude&gt;**/properties&lt;/exclude&gt; &lt;/excludes&gt; &lt;/resource&gt; &lt;/webResources&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;package-prod&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;configuration&gt; &lt;classifier&gt;prod&lt;/classifier&gt; &lt;webappDirectory&gt;${project.build.directory}/${project.build.finalName}-prod&lt;/webappDirectory&gt; &lt;packagingExcludes&gt;WEB-INF/classes/*.jks,WEB-INF/classes/acquirer.properties&lt;/packagingExcludes&gt; &lt;filters&gt; &lt;filter&gt;${project.basedir}/configurations/properties/config_prod.prop&lt;/filter&gt; &lt;/filters&gt; &lt;webResources&gt; &lt;resource&gt; &lt;directory&gt;configurations&lt;/directory&gt; &lt;filtering&gt;true&lt;/filtering&gt; &lt;targetPath&gt;WEB-INF/classes&lt;/targetPath&gt; &lt;excludes&gt; &lt;exclude&gt;**/properties&lt;/exclude&gt; &lt;/excludes&gt; &lt;/resource&gt; &lt;/webResources&gt; &lt;/configuration&gt; &lt;goals&gt; &lt;goal&gt;war&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre>