title: Maven WAR file does not exclude test classes
body: <p>I'm trying to exclude test classes from my final WAR file with Maven.
  Normally it should be done by default if my tests are in src/test/java but it is not doing it in my case.
  Test classes are compiled in folder WEB-INF\test-classes\
  So I added following plugin in pom.xml</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.2.0&lt;/version&gt;
      &lt;configuration&gt;
          &lt;packagingExcludes&gt;**/test-classes/*.class&lt;/packagingExcludes&gt;
      &lt;/configuration&gt;
   &lt;/plugin&gt;
  </code></pre>
  
  <p>But even with that, my test classes are still included in the .war file at the end
  Does anyone have a workaround or can explain me what I'm missing ?
  Thanks</p>
  
  <p><strong>UPDATE : plugins that i use in my pom.xml</strong></p>
  
  <pre><code>         &lt;pluginManagement&gt;
                  &lt;plugins&gt;
                      &lt;!-- fix clean issue where duplicated entries of pom are created--&gt;
                      &lt;!--https://bugs.eclipse.org/bugs/show_bug.cgi?id=405915--&gt;
                      &lt;plugin&gt;
                          &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
                          &lt;version&gt;3.0.0&lt;/version&gt;
                          &lt;configuration&gt;
                            &lt;filesets&gt;
                              &lt;fileset&gt;
                                &lt;directory&gt;src/main/webapp/META-INF&lt;/directory&gt;
                                &lt;includes&gt;
                                  &lt;include&gt;**/pom.properties&lt;/include&gt;
                                  &lt;include&gt;**/pom.xml&lt;/include&gt;
                                &lt;/includes&gt;
                              &lt;/fileset&gt;
                            &lt;/filesets&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
  
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;
                          &lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;
                          &lt;version&gt;1.0.0&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;lifecycleMappingMetadata&gt;
                                  &lt;pluginExecutions&gt;
                                      &lt;pluginExecution&gt;
                                          &lt;pluginExecutionFilter&gt;
                                              &lt;groupId&gt;org.jibx&lt;/groupId&gt;
                                              &lt;artifactId&gt;jibx-maven-plugin&lt;/artifactId&gt;
                                              &lt;goals&gt;
                                                  &lt;goal&gt;bind&lt;/goal&gt;
                                              &lt;/goals&gt;
                                              &lt;versionRange&gt;[1.2.6,)&lt;/versionRange&gt;
                                          &lt;/pluginExecutionFilter&gt;
                                          &lt;action&gt;
                                              &lt;execute&gt;
                                                  &lt;runOnIncremental&gt;true&lt;/runOnIncremental&gt;
                                              &lt;/execute&gt;
                                          &lt;/action&gt;
                                      &lt;/pluginExecution&gt;
  
  
                                      &lt;pluginExecution&gt;
                                          &lt;pluginExecutionFilter&gt;
                                              &lt;groupId&gt;org.apache.openjpa&lt;/groupId&gt;
                                              &lt;artifactId&gt;openjpa-maven-plugin&lt;/artifactId&gt;
                                              &lt;goals&gt;
                                                  &lt;goal&gt;enhance&lt;/goal&gt;
                                              &lt;/goals&gt;
                                              &lt;versionRange&gt;[2.2.2,)&lt;/versionRange&gt;
                                          &lt;/pluginExecutionFilter&gt;
                                          &lt;action&gt;
                                              &lt;execute&gt;
                                                  &lt;runOnIncremental&gt;true&lt;/runOnIncremental&gt;
                                              &lt;/execute&gt;
                                          &lt;/action&gt;
                                      &lt;/pluginExecution&gt;
  
                                      &lt;pluginExecution&gt;
                                          &lt;pluginExecutionFilter&gt;
                                              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                                              &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
                                              &lt;goals&gt;
                                                  &lt;goal&gt;run&lt;/goal&gt;
                                              &lt;/goals&gt;
                                              &lt;versionRange&gt;[1.8,)&lt;/versionRange&gt;
                                          &lt;/pluginExecutionFilter&gt;
                                          &lt;action&gt;
                                              &lt;execute&gt;
                                                  &lt;runOnIncremental&gt;false&lt;/runOnIncremental&gt;
                                              &lt;/execute&gt;
                                          &lt;/action&gt;
                                      &lt;/pluginExecution&gt;
                                  &lt;/pluginExecutions&gt;
                                  &lt;/lifecycleMappingMetadata&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/pluginManagement&gt;
  
              &lt;plugins&gt;  
  
                  &lt;!-- toolchain plugin to use specific JDK 
                   &lt;plugins&gt;
                        &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-toolchains-plugin&lt;/artifactId&gt;
                          &lt;version&gt;1.1&lt;/version&gt;
                          &lt;executions&gt;
                            &lt;execution&gt;
                              &lt;goals&gt;
                                &lt;goal&gt;toolchain&lt;/goal&gt;
                              &lt;/goals&gt;
                            &lt;/execution&gt;
                          &lt;/executions&gt;
                          &lt;configuration&gt;
                            &lt;toolchains&gt;
                              &lt;jdk&gt;
                                &lt;version&gt;1.8&lt;/version&gt;
                                &lt;vendor&gt;ibm&lt;/vendor&gt;
                              &lt;/jdk&gt;
                            &lt;/toolchains&gt;
                          &lt;/configuration&gt;
                        &lt;/plugin&gt;
                      &lt;/plugins&gt;
          --&gt;
  
                    &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.6.1&lt;/version&gt;
                      &lt;configuration&gt;
                        &lt;source&gt;1.6&lt;/source&gt;
                        &lt;target&gt;1.6&lt;/target&gt;
                    &lt;!--     &lt;forceJavacCompilerUse&gt;true&lt;/forceJavacCompilerUse&gt;--&gt;
                      &lt;/configuration&gt;
                    &lt;/plugin&gt;
  
  
                  &lt;!-- OPENJPA --&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.openjpa&lt;/groupId&gt;
                      &lt;artifactId&gt;openjpa-maven-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.2.2&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;includes&gt;com/dsv/express/persistence/domain/*.class&lt;/includes&gt;
                          &lt;enforcePropertyRestrictions&gt;true&lt;/enforcePropertyRestrictions&gt;
                          &lt;persistenceXmlFile&gt;${project.basedir}${persistenceXmlFile-Path}&lt;/persistenceXmlFile&gt;
                      &lt;/configuration&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;enhancer&lt;/id&gt;
                              &lt;phase&gt;process-classes&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;enhance&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                      &lt;dependencies&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;org.apache.openjpa&lt;/groupId&gt;
                              &lt;artifactId&gt;openjpa&lt;/artifactId&gt;
                              &lt;version&gt;2.2.2&lt;/version&gt;
                          &lt;/dependency&gt;
                      &lt;/dependencies&gt;
                  &lt;/plugin&gt;
  
  
          &lt;/plugins&gt;
  </code></pre>