Jacoco 7.10-SNAPSHOT: Lombok annotation is not ignored in the jacoco.exec file (used by Sonar)

946 views
Skip to first unread message

Igal Kopelman

unread,
Dec 21, 2017, 4:59:03 AM12/21/17
to JaCoCo and EclEmma Users
Hello,

I are using Lombok plugin in our Java code and interested in getting a true coverage information in the Sonar final report.

I am using the Jacoco 7.10-SNAPSHOT version right now and was able (by using the "lombok.addLombokGeneratedAnnotation = true"  in the lombok.config file) to generate a "correct" html jacoco reports - which do ignore correctly the lombok annotations when calculating the code coverage percentage.
However - the jacoco.exec file which is also generated, and it's path is passed to the SonarQube, still seems to ignore that  lombok.config file configuration and the coverage which is reflected in it are same as if I am using jacoco 0.7.9

Is that by design? Or am I doing something wrong?


Thanks,

Igal

Marc Hoffmann

unread,
Dec 21, 2017, 5:17:11 AM12/21/17
to jac...@googlegroups.com

Hi Igal,

your observation is correct: With the new filtering feature in 7.10-SNAPSHOT the exec file format has not been touched. Filtering happens at analysis time (report generation). As long as Sonar does not use a new JaCoCo release it will not support filtering.

We hope to release 0.8.0 these days... stay tuned.

Cheers,
-marc

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/ff12bf84-5971-4fab-8781-368974a7adf1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Igal Kopelman

unread,
Dec 21, 2017, 6:23:13 AM12/21/17
to JaCoCo and EclEmma Users
Hi Marc,

Thanks for the prompt reply!
I just want to see if I understand things right:
  1. The exec file format is not changed and will not be changed in 0.7.10 official release and 0.8.0 versions (in respect to the lombok filtering), and this is by design?
  2. The Sonar needs to be "updated" (how?) to be able (also) to filter the lombok annotations in the exec file? Is there a way to do that right now, with the 0.7.10-SNAPSHOT?
Thanks,

Igal

Marc Hoffmann

unread,
Dec 21, 2017, 6:53:00 AM12/21/17
to jac...@googlegroups.com

Hi Igal,

1. Correct, filtering is implemented as report generation time only. This is by design to keep the exec file format stable and simplify configuration: Otherwiese filtering would be required to be configured at runtime AND analysis time the exact same way and exec file format would change every time we add new filters. So exec files are and will not be affected by filtering. (Mabe other features or bug fixes will change the exec file format in future but not filtering).

2. Sonar needs to pick-up our next release. Normally this happens quite quickly. The only way to do it right now is to build a custom version of Sonar. Please understand that we cannot provide support for our downstream products.

Regards,
-marc

Evgeny Mandrikov

unread,
Dec 21, 2017, 8:14:15 AM12/21/17
to JaCoCo and EclEmma Users
Hi Igal,


On Thursday, December 21, 2017 at 12:23:13 PM UTC+1, Igal Kopelman wrote:
I just want to see if I understand things right:
The exec file format is not changed and will not be changed in 0.7.10 official release and 0.8.0 versions (in respect to the lombok filtering), and this is by design?

There won't be 0.7.10 release.
Current 0.7.10-SNAPSHOT will be released as 0.8.0.

exec-file format is not changed by design: if it would change, then current version of Java plugin for SonarQube (as well as JaCoCo plugin for Jenkins) won't even be able to read it, what is even worse than not having filtering.

The Sonar needs to be "updated" (how?)
 
Is there a way to do that right now, with the 0.7.10-SNAPSHOT? to be able (also) to filter the lombok annotations in the exec file?

Java plugin for SonarQube should be updated to use JaCoCo 0.8.0 for generation of report - https://github.com/SonarSource/sonar-java/blob/5.0.0.12796/pom.xml#L91
And they are aware of this and will do the update - https://groups.google.com/d/msg/sonarqube/wyDtmcGvy1k/3q668XPNDAAJ
As well as any downstream projects like Jenkins that do not use XML report but instead generate their own from exec file.
We'll help / collaborate at least with SonarQube developers to address this once JaCoCo 0.8.0 will be released. Today gonna discuss with them plan and time frame of this.
Please understand that propagation to downstream projects takes time and energy.
Thank you for your patience.



Regards,
Evgeny
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages