title: Maven build fails with error message Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test)
body: <p>I'm getting this error while trying to "clean install" a Spring project with Maven.<p>
  Below is the section of "maven-surefire-plugin"<p></p>
  
  <pre><code>&lt;!-- BEGIN: Specific to mapping unit tests and covered code --&gt;
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;coverage-per-test&lt;/id&gt;
          &lt;build&gt;
              &lt;plugins&gt;
                  &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.18.1&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;forkedProcessTimeoutInSeconds&gt;600&lt;/forkedProcessTimeoutInSeconds&gt;
                          &lt;forkMode&gt;always&lt;/forkMode&gt;
                          &lt;reportFormat&gt;plain&lt;/reportFormat&gt;
                          &lt;trimStackTrace&gt;false&lt;/trimStackTrace&gt;
                          &lt;properties&gt;
                              &lt;property&gt;
                                  &lt;name&gt;listener&lt;/name&gt;
                                  &lt;value&gt;org.sonar.java.jacoco.JUnitListener&lt;/value&gt;
                              &lt;/property&gt;
                          &lt;/properties&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
  
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.codehaus.sonar-plugins.java&lt;/groupId&gt;
                  &lt;artifactId&gt;sonar-jacoco-listeners&lt;/artifactId&gt;
                  &lt;version&gt;1.2&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  &lt;!-- END: Specific to mapping unit tests and covered code --&gt;
  </code></pre>
  
  <p>and here's the error :<p></p>
  
  <blockquote>
    <p>[INFO] BUILD FAILURE<P>
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project common-jpa2ddl: There are test failures.<p>
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project common-jpa2ddl: There are test failures.<p>
    [ERROR] -> [Help 1]<p>
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.<p>
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.<p>
    [ERROR] For more information about the errors and possible solutions, please read the following articles:<p>
    [ERROR] [Help 1] <a href="http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException" rel="nofollow">http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException</a><p></p>
  </blockquote>
  
  <pre><code>Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.697 sec
  Running com.teamwill.common.jpa2ddl.Jpa2DDLTest
  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.011 sec &lt;&lt;&lt; FAILURE!
  initializationError(com.teamwill.common.jpa2ddl.Jpa2DDLTest)  Time elapsed: 0.005 sec  &lt;&lt;&lt; ERROR!
  java.lang.NoClassDefFoundError: org/eclipse/aether/RepositorySystemSession
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
      at java.lang.Class.getMethod0(Class.java:3018)
      at java.lang.Class.getMethod(Class.java:1784)
      at org.junit.internal.builders.SuiteMethodBuilder.hasSuiteMethod(SuiteMethodBuilder.java:18)
      at org.junit.internal.builders.SuiteMethodBuilder.runnerForClass(SuiteMethodBuilder.java:10)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
      at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
      at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
  Caused by: java.lang.ClassNotFoundException: org.eclipse.aether.RepositorySystemSession
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 23 more
  
  
  Results :
  
  Tests in error: 
    initializationError(com.teamwill.common.jpa2ddl.Jpa2DDLTest): org/eclipse/aether/RepositorySystemSession
  </code></pre>