I have a multi-module maven project that has both in module unit tests and end-to-end service tests (not quite integration tests since they don't actually integrate with anything) where we mock at the boundaries of the particular service being tested. This latter set of tests (using mockmvc to exercise all layers before deployment) generate a jacoco.exec (or jacoco-it.exec depending on the maven configuration I try) that clearly shows that the tests contribute to code coverage. In fact that vast majority of coverage is in this layer (roughly 40% per jacoco).
When I run sonar analysis on the project locally, or via jenkins, I get the following for the top level tests:
[INFO] Sensor JaCoCoSensor [java]
[INFO] Analysing /Users/tokkov/Documents/workspace/platform/customer/assemblies/service/target/jacoco.exec
[WARNING] Coverage information was not collected. Perhaps you forget to include debug information into compiled classes?
[INFO] Sensor JaCoCoSensor [java] (done) | time=164ms
So sonar finds the jacoco analysis. It finds the compiled code (unpacked the jars into the build directory and specified location with sonar.java.binaries), the compiled code does have debug info (verified with javap -l), but it still throws up its hands and moves on.
Any ideas why sonar ignores the jacoco report? Am I missing a configuration somewhere? It happily gobbles up all of the jacoco.exec reports in the other modules, just not this one.
<sonar.java.binaries>${project.build.directory}/class-fix</sonar.java.binaries>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPaths>${project.build.directory}/jacoco.exec</sonar.jacoco.reportPaths>
The versions: Sonarqube v 7.1 (build 11001), JaCoCo maven plugin v 0.8.1