title: exclusion and inclusion not working in maven assembly plugin
body: <p>In my project I have two classes <strong>Test1.java</strong> and <strong>Test2.java</strong>, my intention is to build two jars in such a way that <strong>test1.jar</strong> should contains only <strong>Tets1.java</strong> and <strong>test2.jar</strong> should contains only <strong>Tets2.java</strong>.</p>
  
  <p>I have added exclusion and inclusion in maven assembly plugin but it seems not working, in both the jars I am able to see <strong>Test1.java</strong> and <strong>Test2.java</strong></p>
  
  <p>my <strong>pom.xml</strong> is given below</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;build-a&lt;/id&gt;
                      &lt;configuration&gt;
                          &lt;excludes&gt;
                              &lt;exclude&gt;Test2.java&lt;/exclude&gt;
                          &lt;/excludes&gt;
                          &lt;includes&gt;
                              &lt;include&gt;Test1.java&lt;/include&gt;
                          &lt;/includes&gt;
                          &lt;archive&gt;
                              &lt;manifest&gt;
                                  &lt;mainClass&gt;com.example.MyMain&lt;/mainClass&gt;
                              &lt;/manifest&gt;
                          &lt;/archive&gt;
                          &lt;descriptorRefs&gt;
                              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                          &lt;/descriptorRefs&gt;
                          &lt;finalName&gt;test1.jar&lt;/finalName&gt;
                      &lt;/configuration&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;assembly&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;build-b&lt;/id&gt;
                      &lt;configuration&gt;
                          &lt;excludes&gt;
                              &lt;exclude&gt;Test1.java&lt;/exclude&gt;
                          &lt;/excludes&gt;
                          &lt;includes&gt;
                              &lt;include&gt;Test2.java&lt;/include&gt;
                          &lt;/includes&gt;
                          &lt;archive&gt;
                              &lt;manifest&gt;
                                  &lt;mainClass&gt;com.example.MyMain&lt;/mainClass&gt;
                              &lt;/manifest&gt;
                          &lt;/archive&gt;
                          &lt;descriptorRefs&gt;
                              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                          &lt;/descriptorRefs&gt;
                          &lt;finalName&gt;test2.jar&lt;/finalName&gt;
                      &lt;/configuration&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;assembly&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p><strong>UPDATED VERSION (pom.xml)</strong></p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;build-a&lt;/id&gt;
                      &lt;configuration&gt;
                          &lt;excludes&gt;
                              &lt;exclude&gt;**/Test.*&lt;/exclude&gt;
                          &lt;/excludes&gt;
                          &lt;includes&gt;
                              &lt;include&gt;**/Test1.*&lt;/include&gt;
                          &lt;/includes&gt;
                          &lt;archive&gt;
                              &lt;manifest&gt;
                                  &lt;mainClass&gt;com.example.MyMain&lt;/mainClass&gt;
                              &lt;/manifest&gt;
                          &lt;/archive&gt;
                          &lt;descriptorRefs&gt;
                              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                          &lt;/descriptorRefs&gt;
                          &lt;finalName&gt;test1.jar&lt;/finalName&gt;
                      &lt;/configuration&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;assembly&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;build-b&lt;/id&gt;
                      &lt;configuration&gt;
                          &lt;excludes&gt;
                              &lt;exclude&gt;**/Test.*&lt;/exclude&gt;
                          &lt;/excludes&gt;
                          &lt;includes&gt;
                              &lt;include&gt;**/Test2.*&lt;/include&gt;
                          &lt;/includes&gt;
                          &lt;archive&gt;
                              &lt;manifest&gt;
                                  &lt;mainClass&gt;com.example.MyMain&lt;/mainClass&gt;
                              &lt;/manifest&gt;
                          &lt;/archive&gt;
                          &lt;descriptorRefs&gt;
                              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                          &lt;/descriptorRefs&gt;
                          &lt;finalName&gt;test2.jar&lt;/finalName&gt;
                      &lt;/configuration&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;assembly&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>