I'm following these docs
https://docs.gradle.org/4.2.1/userguide/jacoco_plugin.html
In a java app, with the java plugin enabled, I've added this line to enable the jacoco plugin
apply plugin: 'jacoco'
The docs state
If the Java plugin is also applied to your project, a new task named jacocoTestReport is created that depends on the test task
So now when I run
./gradlew build jacocoTestReport
I can see it kicking off the tests as part of build, but we have some failing tests, so the whole test task reports as failed.
The jacoco code coverage report doesn't generate anything.
If I run
./gradlew jacocoTestReport
I get a successful report
This may sound like a daft question, but is the reason the first command, ./gradle1 build jacocoTestReport doesn't generate the report, is because of the failing tests?
Would just ./gradlew build run the jacocoTestReport task if the tests passed?