I have successfully applied the jacoco plugin to my build thusly:
apply plugin: 'jacoco'
buildscript {
repositories {
maven {
url "http://${nexusHost}/nexus/content/groups/public"
}
}
dependencies {
classpath 'org.ajoberstar:gradle-jacoco:0.2.0'
}
}
but when I put that snippet in a file named gradle/jacoco.gradle and try to apply like this
apply from: file("gradle/jacoco.gradle")
I get this when I build:
pathToProject/gradle/jacoco.gradle' line: 1
* What went wrong:
A problem occurred evaluating script.
> Plugin with id 'jacoco' not found.
Why do I get different results when I have the literal snippet applying the plugin vs when I apply the snippet via apply from: file() ?
Thanks.