I’m seeing this same error message. In my case, I need to use a special version of Jacoco because I’m building with Java 8 byte codes, and the shipping version of Jacoco doesn’t support it yet. My build script is as such:
apply plugin: 'java'
apply plugin: 'osgi'
apply plugin: 'jacoco'
test{
useTestNG()
}
jacoco {
toolVersion = '0.6.4.201311160552'
}
This is a sub-project. The top-level project defines the repositories:
allprojects {
repositories {
maven {
url 'internal-repository-url-goes-here'
}
}
}
The test process works fine, and I know it is instrumenting with jacoco because before I used the right libraries (https://github.com/jacoco/jacoco/issues/74). Now that I’m using the right jacoco library, it is building fine. However when it comes to generating the report, it fails because the ant task doesn’t have the right version of the jacoco core jar:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Device:ApplicationFramework:jacocoTestReport'.
> taskdef A class needed by class org.jacoco.ant.ReportTask cannot be found: org/jacoco/core/analysis/ICoverageVisitor
using the classloader AntClassLoader[/Users/rbair/.gradle/caches/modules-2/files-2.1/org.jacoco/org.jacoco.ant/0.6.4.201311160552/215bfbeaccfcb5dcfc55523effe956ca168ebd68/org.jacoco.ant-0.6.4.201311160552.jar]