1

I am trying to generate coverage report using jacoco but unable to do so because of following error :

[ant:jacocoReport] Classes in bundle 'pubmindApp' do no match with execution data. For report generation the same class files must be used as at runtime.

Below is my current build gradle :

configurations {
    agentlib
}
ext{
    isBuildMaster = true
    jacocoversion = '0.7.6.201602180812'
}
if (hasProperty('extraChecks') || isBuildMaster == true) {
  jacocoTestReport {
   def coverageSourceDirs = ['src/main/java']
    reports {
        xml.enabled true
        html.enabled true
        csv.enabled false
    }
    sourceDirectories = files(coverageSourceDirs)
  }
  build.dependsOn(jacocoTestReport)
}

jacoco {
    toolVersion = jacocoversion
}

test {
    jacoco {
            destinationFile = file("$buildDir/jacoco/test.exec")
            classDumpFile = file("$buildDir/jacoco/classpathdumps")
    }
    ext.agentlibs = configurations.agentlib.collect {it}
    ext.springInstrument = agentlibs[0]
    // Uncomment the following line to see the test output on console 
    //testLogging.showStandardStreams = true
    println("springframework instrument path: $springInstrument")
    jvmArgs "-Xms256m"
    jvmArgs "-Xmx4096m"
    jvmArgs "-XX:MaxPermSize=256m"
    jvmArgs "-
    Djava.library.path=${root}/java/lib:${service_root}/home/tivo/lib"
    jvmArgs "-javaagent:$springInstrument"
    include "**/Test*.class"
}

test.finalizedBy jacocoTestReportenter code here

I have tried using offline instrumentation, creating classdump but still the same error keeps on popping up. Please help out

prateek gupta
  • 11
  • 1
  • 2
  • 1
    Possible duplicate of [jacoco code coverage report generator showing error : "Classes in bundle 'Code Coverage Report' do no match with execution data"](https://stackoverflow.com/questions/31720139/jacoco-code-coverage-report-generator-showing-error-classes-in-bundle-code-c) – Godin Jul 14 '17 at 13:22

0 Answers0