Generate jacocoTestReport when there is no test code

Hello,

I have a multi-project build where some of the subprojects have no test code, and the jacocoTestReport task does nothing. I would like to be able to force it to generate a report showing no coverage.

I can make it work by creating src/test/java and adding an empty test class, but I would prefer to avoid this. Is there anything I can do to configure it to generate the report when there is no test code?

Thanks!

tasks.jacocoTestReport {
    setOnlyIf { true }
}
1 Like