Jacoco fails at try-with-resources

320 views
Skip to first unread message

anil...@gmail.com

unread,
Feb 13, 2018, 7:38:51 PM2/13/18
to JaCoCo and EclEmma Users
Hi,
I am running Jacoco 0.8.0. Sonarqube Jacoco coverage report gives less coverage (eg. Covered by unit tests (4 of 8 conditions) wherever I have try-with-resources. I found JAVAC.TRYWITH filter. Not sure how to use the filter.

FYI, I am using jacoco-maven-plugin and Sonarqube 5.6.6 integrated with Jacoco. Please help.

Evgeny Mandrikov

unread,
Feb 14, 2018, 3:50:56 AM2/14/18
to JaCoCo and EclEmma Users
Hi,

Filters mentioned on this page and implemented in version 0.8.0 are unconditionally enabled, they do not affect exec file and take place during generation of report from exec file. What means following for tools that directly read exec file and generate their own reports from it (such as SonarQube):


Note: Tools that directly read exec files and embed JaCoCo for this (such as SonarQube or Jenkins) will provide filtering functionality only after they updated to this version of JaCoCo.

from announcement of version 0.8.0 ( https://groups.google.com/d/msg/jacoco/e2PVMeMvA8k/uHsJbi4iAQAJ ) :

Please Note
Tools that directly read exec files (which is not a final report) and embed JaCoCo for generation of report will provide filtering functionality only after they updated to this version of JaCoCo.
So please follow/wait/etc respective vendors such as
So from the above ticked - in case of SonarQube you need SonarJava plugin version 5.1.

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages