1
votes

I am working on a multi-module project and trying to get the source code coverage for the whole project using ant, jacoco and sonarqube (executed from Atlassian Bamboo).

As my project has several classes with the same name, I am able to generate the different jacoco reports for the different modules from ant by including only the requiered class files in each jacoco report generation. When I have all the different .exec files, I merge them into a final jacoco.exec file.

At the time of loading it from sonar by setting the properties:

sonar.jacoco.reportPaths=*jacoco.exec path*

sonar.java.binaries=*path to the directory where all the class files live*

The JaCoCoSensor throws the error:

"Can't add different class with same name"

I understand that the error is properly raised, as I have several classes with the same name in the project.

Is there any way to avoid this issue from sonar?

What is the best way to load the exec reports, taking into account that the project have several classes with the same name?

Thanks for the help!

1
Please edit your question to add a little more context: specifically which Sensor is running when this error is raised.G. Ann - SonarSource Team
@G.Ann-SonarSourceTeam Edited!Malakay
Maybe analyze project with clear separation on modules - see docs.sonarqube.org/display/SCAN/… ?Godin

1 Answers

0
votes

you cannot do it you have to give Classname distinct for your current situation you have exclude classes with same name