[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] AJDT and m2e?


I'm running into an odd problem with m2e and AJDT.  With Andy's help on the SpringSource STS forum, I think I have managed to isolate the problem a little better, but not sure if I am encountering a bug, or if there is something I am missing in my Eclipse configuration.

My original thread can be found at: http://forum.springsource.org/showthread.php?125470-How-to-enable-AspectJ-nature-in-a-Spring-project-with-annotated-and-aj-aspects

In a nutshell, I have a Maven based Spring project.  I'm using Eclispe 3.7 with the following m2e plugins
maven for AJDT:
maven for WTP:

I have some Spring aspects defined with AspectJ annotations.  By themselves, they work fine.  I then added some .aj aspects and enabled AspectJ Capabilities on the project.  Suddenly my Spring aspects are instantiated twice in my junit tests - once by Spring, and once (I believe) by some CTW of the AJ compiler.  (Note that these are junits run within Eclipse).

If I use the -xmlConfigured flag on AJ project properties and specify my own aop.xml file with only my .aj aspect listed there the junits work fine.

I have tried added an <exclude> tag in my aspectj-maven-plugin, excluding the Spring aspects, but they are still run twice.

Is this a bug in m2e?  Or is there a problem with AJDT?  Or am I doing something wrong, or missing some configuration somewhere?

My pom has the following aj-related things


<!-- Support for AspectJ Annotations -->

<!-- AspectJ weaving -->                        

<!-- don't weave any of the Spring aspects with AJ -->