This use case is detailed in the Manage Code Coverage by Unit Tests with Sonar blog post.
There are two different ways to feed Sonar with information on unit tests execution and code coverage:
- Using its embedded engine to let Sonar directly launch the unit tests execution and code coverage. Then, the analyzer will automatically fed the database with data exported from the generated reports.
- Reusing existing reports that have been previously generated by external tools.
Depending on the code coverage tool you used to generate your report, replace jacoco by emma, cobertura or clover in the property name.
See also the Manage Code Coverage by Unit Tests with Sonar blog post.