sbt-jacoco icon indicating copy to clipboard operation
sbt-jacoco copied to clipboard

Coverage for java code files

Open plouf142 opened this issue 4 years ago • 2 comments

Expected vs Actual Behaviour

It should have coverage report for all source, java source AND scala source.

Instead it, I get a voerage report only for scala source.

Steps to Reproduce

Any Play Framework with Java language and unit tests...

And run sbt jacoco.

Examine the html report. Only scala files are listed.

Environment

  • SBT version: 1.3.13
  • Plugin version: 3.4.0
  • Scala version(s): 2.12.13
  • Java version: java-1.8-openjdk

plouf142 avatar Nov 09 '21 15:11 plouf142

After various tests, I found a clue for this issue in the Jacoco FAQ, question Why does a class show as not covered although it has been executed? I followed the various suggestions, without success.

But now I wonder if this is really the way to go. In any case, the java classes are well instrumented, it is only when generating the report that there is a loss.

plouf142 avatar Feb 11 '22 18:02 plouf142

Our project is running into the exact same issue. Are there any updates or known workarounds for this?

jonvnieu avatar Aug 16 '22 17:08 jonvnieu