3

I have a cobertura.ser file, that got generated while integration-test and system test. Now I want to import my coverage this to sonar server.

How can I achieve this, so while executing mvn sonar:sonar the coverage should consider external coberture.ser file?

Can I do this using sonar, where i can see overall coverage obtain during all test run?

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
anish
  • 6,884
  • 13
  • 74
  • 140

1 Answers1

6

You need to set the following paramater to tell Sonar to use a pre-generated report:

sonar.dynamicAnalysis=reuseReports

Secondly Sonar doesn't read the "cobertura.ser" file. It can be configured as follows to read the generated XML report (See cobertura docs):

sonar.cobertura.reportPath=target/reports/coverage.xml

Finally, my reference for all this stuff comes from the from the Sonar wiki:

The Sonarsource tutorials are increasingly pushing JaCoCo. This appears to be an emerging standard (replacing the older defunct Emma project)

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185