Hello, We have 2 questions. Can you help on these - 1) How to pass classes to Jacoco Agent when project is multi module? Excludes in Jacoco Agent only takes a list of classes. Then there are chance of collision if package name and Class name is same. How Jacoco agent will handle that? Also, do you have an example of passing classes from a multi module project?
2) How to pass jar to jacoco Agent to exclude/include or is it not allowed and we need to extract jar to get all classes and then supply to jacoco java agent. Thank you for answering previous questions. It helps a lot. Regards Mehul On Tuesday, 4 July 2023 at 21:01:39 UTC+5:30 Evgeny Mandrikov wrote: > > > On Tue, 4 Jul 2023 at 17:24, Evgeny Mandrikov <[email protected]> wrote: > >> See >> https://github.com/jacoco/jacoco/issues/34#issuecomment-10205525 >> > > ie both slash (/) and dot (.) separated notations (VM and Java names) are > accepted by agent > > while report Maven goal expects filenames > > <https://github.com/jacoco/jacoco/issues/34#issuecomment-10205525> >> > On Tue, 4 Jul 2023 at 08:07, Mehul Parmar <[email protected]> wrote: >> >>> Hello, >>> Can you confirm this? Jacoco java agent accepts '.' naming convention >>> -javaagent:*[yourpath/]*jacocoagent.jar=excludes=*com.abc.package.** >>> -javaagent:*[yourpath/]*jacocoagent.jar=excludes= >>> *com.abc.package.ClassA* >>> >>> But java-maven-plugin and jacococli accepts '/' convention >>> >>> <configuration> >>> <excludes> >>> <exclude>com/abc/ra/sample/init/*</exclude> >>> </excludes> >>> </configuration> >>> >>> java -jar /Users/mehul/Downloads/org.jacoco.cli-0.8.10-nodeps.jar report >>> /Users/mehul/Repos/mehul/abc/abcService/target/jacoco.exec --classfiles >>> /Users/mehul/Repos/mehul/abc/abcService/target/classes --html ./report >>> >>> >>> On Sunday, 2 July 2023 at 15:11:06 UTC+5:30 Mehul Parmar wrote: >>> >>>> Hello, >>>> Yes, I will get same coverage if I get an exec with all classes and >>>> then filter in report or if I filter in exec itself(agent stage) and then >>>> filter in report. But for big Java projects wanted to skip calculating >>>> coverage and record in exec, so yes a little bit of performance >>>> optimizations. >>>> And yes, excluding package in prepare-agent goal worked! >>>> >>>> On Sunday, 2 July 2023 at 13:17:32 UTC+5:30 Evgeny Mandrikov wrote: >>>> >>>>> how to explicit mention that exclude class(prepare-agent) and not >>>>>> java files(report). >>>>>> >>>>>> >>>>> Please refer to the Maven documentation about how to configure plugins >>>>> - you can specify excludes in the configuration of the single goal >>>>> prepare-agent, not for the entire plugin, ie >>>>> >>>>> <configuration> >>>>> <!-- applies to all executions of all goals --> >>>>> </configuration> >>>>> <executions> >>>>> <execution> >>>>> <goals><goal>prepare-agent</goal></goals> >>>>> <configuration> >>>>> <!-- applies only for this execution of this goal --> >>>>> </configuration> >>>>> >>>>>> -- >>>>> Regards, >>>>> Evgeny >>>>> >>>>> -- >>> 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/68de79c7-5860-43a4-b083-fc4aaf85883an%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/jacoco/68de79c7-5860-43a4-b083-fc4aaf85883an%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> Regards, >> Evgeny >> >> -- > Regards, > Evgeny > > -- 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/9493ab60-de95-435e-8bab-0a1d1b8877adn%40googlegroups.com.
