Multi-Project Gradle 3.4 with JUnit 5 and JaCoCo

plugins

(Raja Nadar) #1

Has anybody been successful with JaCoCo code coverage reports for a multi-project Gradle 3.4 and JUnit 5 (M3) based Java 8 solution?

I looked up the samples, and I can get JaCoCo plugin working for JUnit 4.
But for a JUnit 5 based multi-project, I am not able to get JaCoCo running at all.

Either I get codeCoverageReport SKIPPED or after a lot of tweaking, the files are generated with 0 coverage.

My setup is a simple 4 project solution, with no custom source sets or other such customization.
It is a Java 8 based project. I have even tried the afterEvaluate option.

I followed the instructions here: https://docs.gradle.org/current/userguide/jacoco_plugin.html


(Benjamin Muschko) #2

A the moment there’s no tight integration with JUnit 5 and Gradle at all. Therefore there’s also no integration with JaCoCo and JUnit 5. If you want to combined both then you’ll need to look into the Gradle plugin provided by the JUnit 5 team.