Jacoco task is skipped no matter what I do

Adding this to my build script:

apply plugin: 'jacoco'
jacocoTestReport {
    reports {
        xml.enabled true

and running: gradle test jacocoTestReport

produces this result:

Skipping task ':jacocoTestReport' as task onlyIf is false.
:jacocoTestReport SKIPPED

I’m running gradle 2.2.1

My assumption is that you’re only running ‘jacocoTestReport’. You need to also run the test task: ‘gradlew test jacocoTestReport’.

See this discussion for background: http://gradle.1045684.n5.nabble.com/jacoco-questions-td5712017.html