The includes and excludes options of the JaCoCo agent determine for which classes execution data is collected. Except for technical corner cases these options are normally not required. If you exclude classes, no execution data is collected for them.
Report creation is a separate step where all class files which should show up in the report are explicitly provided. Coverage is determined from the provided execution data. If execution data is missing for a particular class, this class is shown as not covered because the report generator cannot distinguish whether the class was excluded from instrumentation or not executed.
If you want to exclude classes from the report please configure the respective report generation tool accordingly.
Hi Evgeny,Thanks for your reply. I am attaching the jacoco agent to the jvm of each service, by doing ssh into the service and executing commands in terminal. And I have to create a jacocoreport by using the jar of that particular service(This is to get the compiled list of classes from the jar). But currently, jacoco is analysing all the maven dependencies of the services as well. So I would like to provide a package restriction. May I know how to achieve this please