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
Thanks, Kishore Mohanavelu On Wednesday, December 30, 2020 at 2:02:10 PM UTC+5:30 Evgeny Mandrikov wrote: > Quoting https://www.jacoco.org/jacoco/trunk/doc/faq.html > > Why do I see classes in the coverage report although I excluded them in > the JaCoCo agent configuration? > > 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. > > On Wednesday, December 30, 2020 at 9:26:26 AM UTC+1 Kishore Mohanavelu > wrote: > >> Hi Guys, >> >> I would like to specify only a list of classes under a particular >> package(eg: com.server) to be analysed by jacoco. I don't want other >> classes under different package to be considered for code coverage. I am >> specifying the package as below, but it is not working. >> >> *Option 1 - Tried:* >> -*java*agent:jacocoagent.jar=address=localhost,port=8084,includes=**/com/server/**,destfile=jacoco_output.exec,output=tcpserver >> >> -cp . -jar ironhide.jar server config.yml & >> >> *Option- 2 - Tried:* >> -*java*agent:jacocoagent.jar=address=localhost,port=8084,includes=**.com.server.**,destfile=jacoco_output.exec,output=tcpserver >> >> -cp . -jar ironhide.jar server config.yml & >> >> What is the format that I have to specify in the includes parameter? Can >> someone help please? >> >> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/f6e4c844-fd54-49cd-97d7-506e0499e843n%40googlegroups.com.
