title: Precedence packagingExcludes and packagingIncludes maven war plugin
body: <p>Recently I configured my application to use "skinny wars" that was described on codehaus (title: Solving the skinny war problem). Basically I exclude all jars from the war and add it as a war <em>and</em> pom dependency to the ear. Now I ran into a problem with two jars. So to me the logical thing to do was include them in the war file using packagingInclude.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
          &lt;packagingExcludes&gt;WEB-INF/lib/*.jar&lt;/packagingExcludes&gt;
          &lt;packagingIncludes&gt;WEB-INF/lib/A.jar, WEB-INF/lib/B.jar&lt;/packagingIncludes&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Using a regex as showed in de <a href="https://maven.apache.org/plugins/maven-war-plugin/examples/including-excluding-files-from-war.html" rel="nofollow noreferrer">plugin documentation</a> and this <a href="https://stackoverflow.com/a/28287967/3100839">answer</a> but it didn't seem to do anything. It just excludes everyting.</p>
  
  <p>In the <a href="http://svn.apache.org/viewvc/maven/plugins/tags/maven-war-plugin-2.6" rel="nofollow noreferrer">source code</a> of the plugin I found that it uses the DocumentScanner of org.codehaus.plexus » plexus-utils. I didn't quite understand how it works.</p>
  
  <p>I thought this was a no brainer. But what am I doing wrong? Could it be that the inclusion doesn't work when A is also a transitive dependency of C?</p>
  
  <p>Edit: Does plugin version play any role? Now I am using 2.6 but previously version 2.1-alpha-2 was used.</p>