I'm using Gradle 4.4 on my Java project with JaCoCo 0.8.0, and Sonar with SonarJava 5.0.1.
I have a class annotated with lombok's @Value
and @Builder
.
My JaCoCo config in build.gradle looks like this:
jacoco {
toolVersion = "0.8.0"
reportsDir = file("$buildDir/reports/jacoco")
}
jacocoTestReport.doFirst{
classDirectories = files("buildDir/classes")
}
task jacocoReport(type: JacocoReport){
sourceSets sourceSets.main
executionData test, integrationTest
}
Also, I have lombok.confi file, with property lombok.addLombokGeneratedAnnotation = true
, and generated stuff does actually have @lombok.Generated
annotation in build/classes.
However, the coverage on Sonar is still low. It reports a ton of conditions and lines to cover.