Thanks Marc,
1) "already instrumened" -

I am using "on-the-fly instrumentation" with <jacoco:coverage> tag. so you 
might be right that already instrumented class might be residing in memory  and 
with second iteration of <jacoco:coverage> getting "already instrumented" 
error. I can you use offline instrumentation with < jacoco:instrument> but is 
there any performance issue associated with offline issue ? What is recommended 
way for instrumentation (offline or on the fly) ? Is there any extra care needs 
to be taken for offline instrumentation, so that instrumented classes should 
not be part of jar or war.

2) Exclude  3rd party Jars
Scope limit with class name is not feasible for me as there are lot many jars 
in classpath. I can limit those classes while generating jacoco report 

Thanks,
-Pravin




On Friday, 23 January 2015 01:03:55 UTC+5:30, Marc R. Hoffmann  wrote:
> Ok, I see two issues here:
> 
> 1) "already instrumened"
> 
> By any chance do you use the jacoco:instrument task in your build? 
> jacoco:coverage does pure in-memory instrumentation and will not persist 
> any instrumented classes on disk.
> 
> 2) Exclude  3rd party Jars
> 
> Instead of excluding 3rd party Jars I would recomment to limit the scope 
> to your code onlye with includes=com.mycompany.*
> 
> Regards,
> -marc
> 
> On 22.01.15 10:48, [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/44e4bc5c-3e81-4671-a270-2bdc53b8bb6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to