jacoco coverage per test setup
<p>I'm using jacoco in order to gather code metrics and import them to sonarQube but i was missing details about coverage per test. So after searching about it i came to <a href="https://deors.wordpress.com/2014/07/04/individual-test-coverage-sonarqube-jacoco/" rel="nofollow">this tutorial</a> but failed to make it work on my project.</p>

<p>here is my pom.xml</p>

<pre><code>&lt;properties&gt;
    &lt;sonarVersion&gt;2.4&lt;/sonarVersion&gt;
    &lt;spring-framework.version&gt;4.0.0.RELEASE&lt;/spring-framework.version&gt;
    &lt;spring-framework.security.version&gt;3.2.5.RELEASE&lt;/spring-framework.security.version&gt;
    &lt;jackson.version&gt;1.9.13&lt;/jackson.version&gt;
    &lt;jacoco.version&gt;0.7.7.201606060606&lt;/jacoco.version&gt;
    &lt;aspectj.version&gt;1.7.4&lt;/aspectj.version&gt;
    &lt;sonar.java.coveragePlugin&gt;jacoco&lt;/sonar.java.coveragePlugin&gt;
    &lt;sonar.dynamicAnalysis&gt;reuseReports&lt;/sonar.dynamicAnalysis&gt;
    &lt;sonar.jacoco.reportPath&gt;${project.basedir}/target/jacoco.exec&lt;/sonar.jacoco.reportPath&gt;
    &lt;sonar.jacoco.itReportPath&gt;${project.basedir}/target/jacoco-it.exec&lt;/sonar.jacoco.itReportPath&gt;
    &lt;sonar.jacoco.jar&gt;${project.basedir}/libs/jacocoagent.jar&lt;/sonar.jacoco.jar&gt;
    &lt;sonar.jacoco.excludes&gt;**/jaxb/**:**/generated/**:**/validators/**:**/dao/**:**/MBeanUtils/**&lt;/sonar.jacoco.excludes&gt;
    &lt;sonar.language&gt;java&lt;/sonar.language&gt;
    &lt;jacoco-listeners.version&gt;2.3&lt;/jacoco-listeners.version&gt;
    &lt;jacoco.utAgentConfig&gt;-XX:-UseSplitVerifier -javaagent:${sonar.jacoco.jar}=destfile=${sonar.jacoco.reportPath},excludes=${sonar.jacoco.excludes}&lt;/jacoco.utAgentConfig&gt;
    &lt;jacoco.itAgentConfig&gt;-javaagent:${sonar.jacoco.jar}=destfile=${sonar.jacoco.itReportPath},excludes=${sonar.jacoco.excludes}&lt;/jacoco.itAgentConfig&gt;
&lt;/properties&gt;

&lt;dependencies&gt;
    &lt;dependency&gt; 
        &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
        &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
        &lt;version&gt;3.0.1&lt;/version&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
       &lt;groupId&gt;javax.validation&lt;/groupId&gt;
       &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
       &lt;version&gt;1.0.0.GA&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;opendmk.java.net&lt;/groupId&gt;
        &lt;artifactId&gt;jdmkrt&lt;/artifactId&gt;
        &lt;version&gt;1.0-b02&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.betfair.net.java.opendmk&lt;/groupId&gt;
      &lt;artifactId&gt;core&lt;/artifactId&gt;
      &lt;version&gt;1.0-b02&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;commons-lang&lt;/groupId&gt;
        &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
        &lt;version&gt;2.6&lt;/version&gt;
    &lt;/dependency&gt;       
    &lt;dependency&gt;
        &lt;groupId&gt;org.quartz-scheduler&lt;/groupId&gt;
        &lt;artifactId&gt;quartz&lt;/artifactId&gt;
        &lt;version&gt;2.2.2&lt;/version&gt;
        &lt;exclusions&gt;
            &lt;exclusion&gt;
              &lt;groupId&gt;c3p0&lt;/groupId&gt;
              &lt;artifactId&gt;c3p0&lt;/artifactId&gt;
            &lt;/exclusion&gt;
        &lt;/exclusions&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
        &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
        &lt;version&gt;1.2&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;commons-io&lt;/groupId&gt;
        &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
        &lt;version&gt;2.1&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;!-- Hibernate --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
        &lt;version&gt;4.1.3.Final&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
        &lt;version&gt;1.0.0.Final&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
        &lt;version&gt;4.2.0.Final&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
        &lt;artifactId&gt;resteasy-multipart-provider&lt;/artifactId&gt;
        &lt;version&gt;2.3.7.Final&lt;/version&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;commons-net&lt;/groupId&gt;
        &lt;artifactId&gt;commons-net&lt;/artifactId&gt;
        &lt;version&gt;3.1&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;commons-codec&lt;/groupId&gt;
        &lt;artifactId&gt;commons-codec&lt;/artifactId&gt;
        &lt;version&gt;1.6&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.ibatis&lt;/groupId&gt;
        &lt;artifactId&gt;ibatis-sqlmap&lt;/artifactId&gt;
        &lt;version&gt;2.3.0&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
        &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
        &lt;version&gt;4.3.6&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
        &lt;artifactId&gt;httpmime&lt;/artifactId&gt;
        &lt;version&gt;4.3.6&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
        &lt;artifactId&gt;jsr311-api&lt;/artifactId&gt;
        &lt;version&gt;1.1&lt;/version&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
        &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
        &lt;version&gt;3.0.5.Final&lt;/version&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;!-- SPRING --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
        &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.security.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
        &lt;artifactId&gt;spring-security-crypto&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.security.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
        &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.security.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
        &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.security.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
        &lt;version&gt;${spring-framework.security.version}&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;!-- LOG4J --&gt;  
    &lt;dependency&gt;
        &lt;groupId&gt;log4j&lt;/groupId&gt;
        &lt;artifactId&gt;log4j&lt;/artifactId&gt;
        &lt;version&gt;1.2.16&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
        &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
        &lt;version&gt;${aspectj.version}&lt;/version&gt;
   &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
        &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
        &lt;version&gt;${aspectj.version}&lt;/version&gt;
   &lt;/dependency&gt;
   &lt;dependency&gt;
        &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
        &lt;artifactId&gt;aspectjtools&lt;/artifactId&gt;
        &lt;version&gt;${aspectj.version}&lt;/version&gt;
   &lt;/dependency&gt;
    &lt;!-- JSON --&gt; 
    &lt;dependency&gt;
        &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
        &lt;version&gt;${jackson.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-core-asl&lt;/artifactId&gt;
        &lt;version&gt;${jackson.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;!-- Need for LicenseUtils --&gt;  
    &lt;dependency&gt;
        &lt;groupId&gt;org.jdom&lt;/groupId&gt;
        &lt;artifactId&gt;jdom&lt;/artifactId&gt;
        &lt;version&gt;1.1&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;!-- JUnit --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;4.12&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;!-- DBUnit --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.dbunit&lt;/groupId&gt;
        &lt;artifactId&gt;dbunit&lt;/artifactId&gt;
        &lt;version&gt;2.5.1&lt;/version&gt;
    &lt;/dependency&gt;   
    &lt;dependency&gt;
        &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
        &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
        &lt;version&gt;2.3.3&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.mockito&lt;/groupId&gt;
        &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
        &lt;version&gt;1.9.5&lt;/version&gt;
    &lt;/dependency&gt;       
    &lt;dependency&gt;
        &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
        &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
        &lt;version&gt;1.4&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;httpunit&lt;/groupId&gt;
        &lt;artifactId&gt;httpunit&lt;/artifactId&gt;
        &lt;version&gt;1.7&lt;/version&gt;
    &lt;/dependency&gt;           
    &lt;dependency&gt;
        &lt;groupId&gt;mysql&lt;/groupId&gt;
        &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
        &lt;version&gt;5.1.6&lt;/version&gt;
    &lt;/dependency&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;${jacoco-listeners.version}&lt;/version&gt;
       &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
            &lt;artifactId&gt;sonar-maven-plugin&lt;/artifactId&gt;
            &lt;dependencies&gt;
                &lt;dependency&gt;
                    &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt;
                    &lt;artifactId&gt;plexus-utils&lt;/artifactId&gt;
                    &lt;version&gt;1.1&lt;/version&gt;
                &lt;/dependency&gt;
            &lt;/dependencies&gt;
        &lt;/plugin&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.19.1&lt;/version&gt;   
            &lt;configuration&gt;
               &lt;skip&gt;true&lt;/skip&gt;
               &lt;trimStackTrace&gt;false&lt;/trimStackTrace&gt;
            &lt;/configuration&gt;                
            &lt;executions&gt;
                &lt;execution&gt;
                    &lt;id&gt;unit-tests&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;argLine&gt;${jacoco.utAgentConfig}&lt;/argLine&gt;
                        &lt;testFailureIgnore&gt;true&lt;/testFailureIgnore&gt;                     
                        &lt;skip&gt;false&lt;/skip&gt;
                        &lt;includes&gt;
                            &lt;include&gt;**/*Test.java&lt;/include&gt;
                        &lt;/includes&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;/execution&gt;
            &lt;/executions&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;
</code></pre>

<p>It runs fine if i remove this block :</p>

<pre><code>&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;
</code></pre>

<p>But it fails with this block giving the following error :</p>

<pre><code>org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (unit-tests) on project: Execution unit-tests of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
org.apache.maven.surefire.util.SurefireReflectionException: org.sonar.java.jacoco.JacocoController$JacocoControllerError: Unable to access JaCoCo Agent - make sure that you use JaCoCo and version not lower than 0.6.2.
    at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:135)
    at org.apache.maven.surefire.booter.ForkedBooter.createProviderInCurrentClassloader(ForkedBooter.java:321)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: org.sonar.java.jacoco.JacocoController$JacocoControllerError: Unable to access JaCoCo Agent - make sure that you use JaCoCo and version not lower than 0.6.2.
    at org.sonar.java.jacoco.JacocoController.&lt;init&gt;(JacocoController.java:48)
    at org.sonar.java.jacoco.JacocoController.getInstance(JacocoController.java:39)
    at org.sonar.java.jacoco.JUnitListener.&lt;init&gt;(JUnitListener.java:33)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:383)
    at org.apache.maven.surefire.util.ReflectionUtils.instantiate(ReflectionUtils.java:112)
    at org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory.createCustomListeners(JUnit4RunListenerFactory.java:45)
    at org.apache.maven.surefire.junit4.JUnit4Provider.&lt;init&gt;(JUnit4Provider.java:110)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:131)
    ... 4 more
Caused by: java.lang.NoClassDefFoundError: org/jacoco/agent/rt/RT
    at org.sonar.java.jacoco.JacocoController.&lt;init&gt;(JacocoController.java:46)
    ... 19 more
Caused by: java.lang.ClassNotFoundException: org.jacoco.agent.rt.RT
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 20 more

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution unit-tests of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
org.apache.maven.surefire.util.SurefireReflectionException: org.sonar.java.jacoco.JacocoController$JacocoControllerError: Unable to access JaCoCo Agent - make sure that you use JaCoCo and version not lower than 0.6.2.
    at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:135)
    at org.apache.maven.surefire.booter.ForkedBooter.createProviderInCurrentClassloader(ForkedBooter.java:321)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: org.sonar.java.jacoco.JacocoController$JacocoControllerError: Unable to access JaCoCo Agent - make sure that you use JaCoCo and version not lower than 0.6.2.
    at org.sonar.java.jacoco.JacocoController.&lt;init&gt;(JacocoController.java:48)
    at org.sonar.java.jacoco.JacocoController.getInstance(JacocoController.java:39)
    at org.sonar.java.jacoco.JUnitListener.&lt;init&gt;(JUnitListener.java:33)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:383)
    at org.apache.maven.surefire.util.ReflectionUtils.instantiate(ReflectionUtils.java:112)
    at org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory.createCustomListeners(JUnit4RunListenerFactory.java:45)
    at org.apache.maven.surefire.junit4.JUnit4Provider.&lt;init&gt;(JUnit4Provider.java:110)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:131)
    ... 4 more
Caused by: java.lang.NoClassDefFoundError: org/jacoco/agent/rt/RT
    at org.sonar.java.jacoco.JacocoController.&lt;init&gt;(JacocoController.java:46)
    ... 19 more
Caused by: java.lang.ClassNotFoundException: org.jacoco.agent.rt.RT
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 20 more

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.RuntimeException: There was an error in the forked process
org.apache.maven.surefire.util.SurefireReflectionException: org.sonar.java.jacoco.JacocoController$JacocoControllerError: Unable to access JaCoCo Agent - make sure that you use JaCoCo and version not lower than 0.6.2.
    at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:135)
    at org.apache.maven.surefire.booter.ForkedBooter.createProviderInCurrentClassloader(ForkedBooter.java:321)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: org.sonar.java.jacoco.JacocoController$JacocoControllerError: Unable to access JaCoCo Agent - make sure that you use JaCoCo and version not lower than 0.6.2.
    at org.sonar.java.jacoco.JacocoController.&lt;init&gt;(JacocoController.java:48)
    at org.sonar.java.jacoco.JacocoController.getInstance(JacocoController.java:39)
    at org.sonar.java.jacoco.JUnitListener.&lt;init&gt;(JUnitListener.java:33)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:383)
    at org.apache.maven.surefire.util.ReflectionUtils.instantiate(ReflectionUtils.java:112)
    at org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory.createCustomListeners(JUnit4RunListenerFactory.java:45)
    at org.apache.maven.surefire.junit4.JUnit4Provider.&lt;init&gt;(JUnit4Provider.java:110)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:131)
    ... 4 more
Caused by: java.lang.NoClassDefFoundError: org/jacoco/agent/rt/RT
    at org.sonar.java.jacoco.JacocoController.&lt;init&gt;(JacocoController.java:46)
    ... 19 more
Caused by: java.lang.ClassNotFoundException: org.jacoco.agent.rt.RT
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 20 more

    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:584)
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:460)
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:229)
    at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:201)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1026)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:862)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:755)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    ... 20 more
</code></pre>

<p>Thanks for any help.</p>