Thank you Evgeny. The idea you proposed definitely helps! Will try it out and update here!
On Wednesday, December 30, 2020 at 2:27:04 PM UTC+5:30 Evgeny Mandrikov wrote: > On Wednesday, December 30, 2020 at 9:48:10 AM UTC+1 Kishore Mohanavelu > wrote: > >> 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 >> > > If you create report using JaCoCo Command Line interface, then use > "--classfiles" parameter to specify only classes that you want - see > https://www.jacoco.org/jacoco/trunk/doc/cli.html > For example by unzipping your JAR into temporary directory and removing > unwanted classes. > Please have a look at the documentation and already existing answers, for > example similar scenario was already discussed in > https://groups.google.com/g/jacoco/c/0QkOV5u1w6Y/m/Aept20V_AgAJ > > > 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/28d29630-90b7-4039-ba95-f74eacfd0d22n%40googlegroups.com.
