Hi Marc,
1] The restriction on my side was , I can NOT change pom.xml's (there are 100+ pom.xml's : multi-module maven project). I should use jacoco-maven-plugin and pass all parameters as command-line arguments for prepare-agent goal. Is it possible to pass "exclude" parameter via command-line rather configuring pom's ?
steps followed:
-> compile - classes generated
-> instrument - replace generated-classes with instrumented-classes
-> test - perform unit tests using instrumented classes (ex: mvn org.jacoco:jacoco-maven-plugin:prepare-agent test)
-> restore-instrumented-classes - restore back to original classes on disk for further analysis
I verified & looks fine to me for couple of projects (both testng/power-mock based test cases). it looks jacoco agent is identifying the pre-instrumented classes at run time and not-instrumenting the again.
I hope there should NOT be any minute discrepancy with this process. Can you please confirm the steps once ?
-Regards,
Kesav.