Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sonar + Jacoco + Junit 5 : No information about coverage per test

I am trying to get coverage per test feature working with Sonarqube 7.

I am using jacoco-maven-plugin and my tests are running with JUnit 5.

I successfully managed to get global Coverage on Sonarqube dashboard, but I would like to go deeper by being able to see which tests covered which lines of my classes.

I've tried with the given configuration here but without success : I get the following message in the logs 'No information about coverage per test'. I see that this can be obtained by adding a listener org.sonar.java.jacoco.JUnitListener, but it is a JUnit 4 listener, so I guess it is not working because of that.

How can I manage to make the Coverage per test feature work with JUnit 5 ?

like image 773
rico Avatar asked Nov 07 '22 04:11

rico


1 Answers

I have some problem and solved change version of surefire-plugin:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.22.2</version>
</plugin>
like image 135
rlresende Avatar answered Nov 18 '22 15:11

rlresende