JaCoCo coverage not generated

Hello Team,

I have added all the pre-requisite for jacoco but didn’t get any jacoco report generated below is configuration used in build.gradle

test {
finalizedBy jacocoTestReport
}

jacocoTestReport {
dependsOn test
}

jacoco{
toolVersion = “0.8.11”
reportsDirectory = layout.buildDirectory.dir(“reports/jacoco/test”)
}

jacocoTestReport {
reports {
xml.required = true
csv.required = true
html.outputLocation = layout.buildDirectory.dir(‘jacocoHtml’)
}
}

But getting below as warnings:-

Define the property as well.

property ‘sonar.coverage.jacoco.xmlReportPaths’, ‘build/reports/jacoco/jacoco.xml’

Can suggest what is missing in configuration to generate Jacoco report.

Hey there.

There’s two seperate problems to consider:

  • No JaCoCo report generated at all
  • No JaCoCo report found by SonarQube

If you’re facing the first issue… there are some docs related to this. Specifically, make sure you’re running gradle test jacocoTestReport and that the XML report is actually being generated.

SonarQube is only involved in reading the report, it’s not involved in generating it.

Does *.xlsx and *.txt extensions supported in sonarqube for scanning as passed by sonar.sources and we want to pass the same is there any method

Hey there.

Stick to the initial topic, and create a new one for others.

Thanks for the reply

There’s two seperate problems to consider:

  • No JaCoCo report generated at all
  • No JaCoCo report found by SonarQube

If you’re facing the first issue… there are some docs related to this. Specifically, make sure you’re running gradle test jacocoTestReport and that the XML report is actually being generated.

SonarQube is only involved in reading the report, it’s not involved in generating it.