Hello Anonymous, long time since I did something with Ant :-). Do you fork the JVM for testing? Then the agent should get a fresh chance to instrument classes. If building and testing of both projects run on the same JVM I would expect such errors.
Regards Mirko -- Sent from my mobile On Jan 22, 2015 10:48 AM, <[email protected]> wrote: > I am using Jacoco with Ant for codecoverage. In my build script file, I am > running 'Jacoco:coverage' with Junit on two projects.(I have 2 projects in > my workspace with single build script.). 'Jacoco:coverage' task is running > successfuly for 1st project but it is giving errors for second project. one > of of those is as bellow- > Caused by: java.lang.IllegalStateException: Class > org/junit/runner/notification/RunNotifier$SafeNotifier is already > instrumented. > > Build file tags (snap) are as bellows- > <jacoco:coverage destfile="${log.jacoco.dir}/${project.name}/jacoco.exec"> > <junit printsummary="yes" > errorProperty="test.failed" failureProperty="test.failed" > haltonfailure="yes" fork="true"> > .. > ... > .. > </junit> > <jacoco:coverage> > > also, classpath variable is being shared between two projects (above > jacoco:coverage task is being called in loop). > > So from my understanding, due to all classes from classpath variable are > already been instrumented in first iteration, it is giving 'class is > already instrumented' error in next iteration. > > Is there any way where we can exclude third party jars from > instrumentation. I tried with excludes option of <jacoco:coverage> tag > where we can exclude classes, but in my case I have multiple jars in > classpath so its not feasible to mentioned every class names (even regex > with package) > > -- > 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/cb0cb143-4c50-4f6c-8bad-bb136f8f4899%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAK8jvqxTzwH2Rt-2kHaROiQDXkvmZ33P1vOUh2Nwg4X6ZUwBvg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
