No information about coverage by test


Code Analyzer for Java * 5.7 (build 15470) installed

I have setup for jacoco in pom.xml

I first execute:

mvn -P coverage clean test

and I file is produced under:


Then I run:

mvn sonar:sonar -P sonar4 -Dsonar.issuesReport.json.enable=true

From the log I can find:

[INFO] Sensor FindBugs Sensor [findbugs] (done) | time=13069ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/repo/eraonel/git/mje-custom-java-rules/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=90ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Analysing /repo/eraonel/git/mje-custom-java-rules/target/jacoco.exec
[INFO] No information about coverage per test.
[INFO] Sensor JaCoCoSensor [java] (done) | time=396ms

Do you know what the reason could be for this?



Hi, What is the issue exactly ?
the logs tell you that you won’t have information about which test covered which lines. This is a deprecated feature (as documented in ). You get this information because you did not configured the junit listener so this is expected as far as I can tell.

Ok I did not know that it was deprecated. But now I know. Thx for informing me



1 Like

Hi Nicolas,

I have the same problem as @eraonel here who started this thread. I am able to get all the coverage information except Coverage per Test which you have mentioned above, that it is deprecated.
I read another thread on this forum which was dated this year and the person could successfully get the information on what tests covered particular line of code by clicking on the green bar on the side.

I would really like this information in my sonarqube project.

I am using the following:
jacocoant.jar from jacoco v0.8.2

The unit tests are run as part of an Ant build.
I have wrapped the junit tests with jacoco coverage tags:

<jacoco:coverage enabled="{coverage.enabled}" destfile="{jacoco.dir}/">

  <junit maxmemory="1024M"

                <formatter type="xml" />

                    <path refid="additional-junit-classpath" />
                    <fileset refid="fileset:third-party_jars-for-tests" />
                    <pathelement path="${}/acceptanceTest-classes" />
                    <pathelement path="${}/test-classes" />
                    <pathelement path="${}/../core/test-classes" />
                <batchtest todir="${test.result.dir}">
                    <fileset dir="${}/../core/acceptanceTest-classes">
                        <include name="**/blah.class" />
                        <include name="**/blah.class" />
                    <fileset dir="${}/acceptanceTest-classes">
                        <include name="**/*Test.class" />
                        <exclude name="**/blah.class" />


The jacoco report is successfully created after running the Ant build with the above code.
After this I run the sonar-scanner on a linux environment using the following command line command:

sonar-scanner -Dproject.settings=$locationOfPropertyFile


Some properties from the file:

sonar.junit.reportPaths={env.blah}/test-results sonar.surefire.reportsPath={env.blah}/test-results

Is there anyway I can get the coverage per test information?
Your help with be highly appreciated :slight_smile: