Gradle plugin doesn't merge jacoco execution data

gradle
jacoco
coverage

(Andrew Fitzgerald) #1
  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    sonar gradle plugin 2.6.2
    gradle 4.8
    sonar server 5.6.6

  • error observed
    adding entries to “sonar.jacoco.reportPaths” does not impact the reported code coverage

  • steps to reproduce
    run 2 test tasks with different coverages, and add them both to “sonar.jacoco.reportPaths”

  • potential workaround
    run the JacocoMerge and set “sonar.jacoco.reportPaths” = .destinationFile

How to manage jacoco data should also probably be mentioned in the “Analyzing Custom Source Sets” section of the wiki.


(Balázs Hosszu) #2

Please note your Sonar Server is a bit old, current docs are probably outdated in regards to that: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Gradle

You should check in your Sonar instance ( Administration -> Java), but I think you have this property available which might help:

sonar.jacoco.itReportPath


(Tibor Blenessy) #3

Hello,

this should work. Can you post how you configured your sonarqube task in build.gradle ? Do you have multi-project build?