0

I have a jacoco agent that is attached to a webservice. I executed my automation test cases and extracted the jacoco-client.exec from the webservice using the ExecutionDataClient. Now I am trying to generate a jacoco report for the webservice using the jacoco-client.exec file.

I am using the below command to generate the report.

java -jar jacococli.jar report jacoco-client.exec --classfiles rest-service2-0.0.1-SNAPSHOT.jar --html report

The webservice code repo is present as a separate repo and it is not a part of the automation code repo. So I cannot provide the classfiles path directly in the above command. So instead i am providing the application jar.

The issue is, jacoco is generating the code coverage report for all the maven dependencies in the jar along with the original code. But I need the code coverage for the application code alone and not the dependencies code. I am entirely new to using jacoco and don't know how to proceed further. Can someone please help me with this please.

enter image description here

Kishore Mohanavelu
  • 439
  • 1
  • 6
  • 17
  • Does this answer your question? [Maven Jacoco Configuration - Exclude classes/packages from report not working](https://stackoverflow.com/questions/27799419/maven-jacoco-configuration-exclude-classes-packages-from-report-not-working) – samabcde Nov 25 '20 at 05:42
  • @samabcde I have seen the answer. But I cannot exclude all the maven dependencies by configuring it each time. I am afraid, this is not feasible. – Kishore Mohanavelu Nov 25 '20 at 06:14
  • Then is it possible to [include specific packages only](https://stackoverflow.com/questions/54055625/how-to-specify-the-specific-packages-for-the-jacoco-check)? – samabcde Nov 25 '20 at 06:25
  • @samabcde I am not sure whether includes will do the exclude for the remaining packages. But will give it a try and let you know. – Kishore Mohanavelu Nov 25 '20 at 06:38

0 Answers0