sonarqubeclover

SonarQube isn't showing openclover coverage report


I'm having difficulties setting up openclover 4.2.0 to work with SonarQube 6.0.

Here's what I have in logs:

[INFO] [08:42:14.706] Sensor org.sonar.plugins.clover.CloverSensor
[INFO] [08:42:14.707] 2/2 source files have been analyzed
[INFO] [08:42:14.707] Parsing /workspace/topparent/biz/target/site/clover/clover.xml
[WARN] [08:42:14.709] Resource /workspace/topparent/biz/src/main/java/biz/BizClass.java was not found.
[WARN] [08:42:14.710] Resource /workspace/topparent/biz/src/main/java/integration/FirstClass.java was not found.
[INFO] [08:42:14.711] Matched files in report : 0%
[WARN] [08:42:14.711] 2 files in clover report did not match any file in SonarQube Index : /workspace/topparent/biz/src/main/java/biz/BizClass.java, /workspace/topparent/biz/src/main/java/integration/FirstClass.java, 
[INFO] [08:42:14.711] Sensor org.sonar.plugins.clover.CloverSensor (done) | time=5ms

I don't know why the .java files aren't found, the path is correct. I guess I don't see the coverage report because of this:

Matched files in report : 0%

But why?


Solution

  • I was doing:

    mvn clover:setup verify clover:aggregate clover:clover sonar:sonar -sonar.host.url=...
    

    I broke this into 2 separate commands:

    mvn clover:setup verify clover:aggregate clover:clover
    

    then

    mvn sonar:sonar -sonar.host.url=...
    

    And it works now.

    Matched files in report : 100%