Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ + Cobetura

>From what I can tell, the problem is that the AspectJ compiler, under Maven, re-compiles the src/main/java code *after* Cobetura has run on it.

Apparently, the theory is that you may have aspects in src/test/aspects that affect code in src/main/java, so it recompiles src/main/java and src/test/java to target/test-classes.  The cobetura-enhanced files in target/classes simply aren't seen while the tests are running.

Many people thing this is a questionable practice, and the plugin will soon have an option to turn off this behavior (off will likely become the default in the future), which should make it compatible with Cobetura.

On 8/2/06, Eugene Kuleshov <eu@xxxxxxxx> wrote:
Howard,

  Can you try from the ant or make maven plugin to use Cobertura 1.8?

  If I am not mistaken, Cobertura 1.7 has explicitly defined AJ
attributes, so I can't be sure if the list of those attributes in AJ
hasn't been changed since it was created in Cobertura.
  Cobertura 1.8 is using new ASM's "passtrough" mode for all unknown
attributes, so it should work for all AJ attributes as long as they not
using anything from class constant pool.

  BTW, what kind of error you are getting from m2 plugin?

  regards,
  Eugene


Howard Lewis Ship wrote:
> I'm using the Maven plugin.  Version 2.0 of the plugin using Cobertura
> 1.7 :
>
> http://www.ibiblio.org/maven2/org/codehaus/mojo/cobertura-maven-plugin/2.0/cobertura-maven-plugin-2.0.pom
>
>
>
>
> On 8/1/06, Ron Bodkin <rbodkin@xxxxxxxxxxxxxx> wrote:
>> I was able to use a fairly recent dev build of Cobertura with AspectJ,
>> although it still had a few areas where it could do better (e.g., it
>> reported coverage for declare parents: in an aspect, driving down the
>> coverage). But it did provide coverage measurements and reports, even
>> in the
>> aspects...
>>
>> -----Original Message-----
>> From: aspectj-users-bounces@xxxxxxxxxxx
>> [mailto: aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Eugene Kuleshov
>> Sent: Tuesday, August 01, 2006 9:07 AM
>> To: aspectj-users@xxxxxxxxxxx
>> Subject: Re: [aspectj-users] AspectJ + Cobetura
>>
>> Howard,
>>
>>   Can you check what version of Cobertura is used by Maven plugin?
>> AspectJ issues should be fixed in Cobertura 1.7+.
>>   Though there are some differences in Cobertura 1.7 and 1.8 in regards
>> to custom AJ attributes support. Cobertura 1.8 is using ASM 2.2.1 which
>> is using "pass-trough" mode to process unknown/custom attributes (like
>> those added by AJ).
>>
>>   I may be also worth to check if it work from Ant...
>>
>>   regards,
>>   Eugene
>>
>>
>> Howard Lewis Ship wrote:
>> > Has anyone managed to get AspectJ working with Cobetura under Maven 2?
>> >
>> > http://cobertura.sourceforge.net/
>> >
>> > Cobetura is open source code coverage tool. It does bytecode
>> > enhancement and trips up over some of the AspectJ bytecode.
>> >
>>

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

Back to the top