0

I am working on the SonarQube code coverage...I have implemented locally and able to see jacocoTestReprt and all other necessary files...but when I run the task on Jenkins jacoco not able to generate any files.

In app/build.gradle

task jacocoTestReport(type: JacocoReport, dependsOn: [‘testProdReleaseUnitTest’]) {

reports { xml.enabled = true html.enabled = true }

def fileFilter = ['/R.class', '/R$.class', '**/BuildConfig.', '/Manifest*.*', 'android//.'] def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/prodRelease/classes", excludes: fileFilter) def mainSrc = "${project.projectDir}/src/main/java"

getSourceDirectories().setFrom(files([mainSrc])) getClassDirectories().setFrom(files([debugTree])) getExecutionData().setFrom(fileTree(dir: "$buildDir", includes: ["jacoco/testProdReleaseUnitTest.exec"])
}

Jenkins artifacts: enter image description here

Girish
  • 2,196
  • 2
  • 18
  • 24
  • can you share jenkins logs? – wia May 11 '21 at 21:18
  • Even I am facing the same issue with the maven plugin. https://stackoverflow.com/questions/67524321/code-coverage-and-reports-not-generating-on-sonarqube-for-java-using-maven-and-j – aniket kanojia May 17 '21 at 14:18

0 Answers0