title: maven run junit test
body: <p>I'm having trouble compiling and running JUnit tests using a maven project.</p>
  
  <p>In the pom.xml I added those lines to configure the surfire plugin:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.16&lt;/version&gt;
      &lt;configuration&gt;
          &lt;encoding&gt;UTF-8&lt;/encoding&gt;                    
          &lt;skipTests&gt;false&lt;/skipTests&gt;                                 
          &lt;includes&gt;
              &lt;include&gt;**/*.java&lt;/include&gt;
          &lt;/includes&gt;
      &lt;/configuration&gt;
  
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;unit-test&lt;/id&gt;
              &lt;phase&gt;test&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;test&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;skip&gt;false&lt;/skip&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/Client*.java&lt;/include&gt;
                  &lt;/includes&gt;   
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>the tests classes are under the path "src/test/java//".</p>
  
  <p>When I run the command <code>mvn test</code> I obtain this output:</p>
  
  <pre><code>[INFO] Storing buildScmBranch: trunk
  [INFO] [resources:resources {execution: default-resources}]
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 10 resources
  [INFO] [cxf-codegen:wsdl2java {execution: generate-sources}]
  [INFO] [compiler:compile {execution: default-compile}]
  [INFO] Nothing to compile - all classes are up to date
  [INFO] [resources:testResources {execution: default-testResources}]
  [INFO] Not copying test resources
  [INFO] [compiler:testCompile {execution: default-testCompile}]
  [INFO] Not compiling test sources
  [INFO] [surefire:test {execution: default-test}]
  [INFO] Tests are skipped.
  [INFO] [surefire:test {execution: unit-test}]
  [INFO] No tests to run.
  [INFO] ------------------------------------------------------------------------
  [ERROR] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.)
  </code></pre>
  
  <p>I really can't figure out where I'm wrong.</p>
  
  <p><strong>EDIT:</strong>
  I changed the pom configuration as follows, because I also noticed that the tests classes were also not compiled:</p>
  
  <pre><code>&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;2.0.2&lt;/version&gt;
      &lt;configuration&gt;
          &lt;source&gt;1.6&lt;/source&gt;
          &lt;target&gt;1.6&lt;/target&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;default-testCompile&lt;/id&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.6&lt;/source&gt;
                  &lt;target&gt;1.6&lt;/target&gt;
                  &lt;skip&gt;false&lt;/skip&gt;
                  &lt;additionalClasspathElements&gt;
                      &lt;additionalClasspathElement&gt;${basedir}/target/*.jar&lt;/additionalClasspathElement&gt;
                  &lt;/additionalClasspathElements&gt;
                  &lt;directory&gt;${basedir}/src/test/java&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/*.*&lt;/include&gt;
                  &lt;/includes&gt; 
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>In this way maven start to consider my test sources and try to compile it, even if it fails to compile them because I have generated code with cxf-codegen-plugin, that test compilation seems not to see it.</p>