Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] aspectj-maven-plugin and -xmlConfigured

Hi,

I think, as -xmlConfigured is so new, that it probably won't be
supported by the aspectj maven plugin yet.  We should probably test
out the scenario you want to use it for simply from the command line
first, before looking at whether it can be used from maven.

Here is my small scenario that is a bit like what you are doing:

--- A.java
aspect A {
 before():staticinitialization(*) {}
}

--- B.java
aspect B {
  before():staticinitialization(*) {}
}

ajc -outjar aspects.jar A.java B.java

--- aop.xml
<aspectj>
 <aspects>
  <aspect name="A"/>
 </aspects>
</aspectj>

--- Code.java
public class Code {
}

> ajc -xmlConfigured aop.xml Code.java -aspectpath aspects.jar -showWeaveInfo
Join point 'staticinitialization(void Code.<clinit>())' in Type 'Code'
(Code.java:1) advised by before advice from 'A' (aspects.jar!
A.class:2(from A.java))

So we can see -xmlConfigured flips the compiler into an 'opt-in' mode
where aspects must be named before they are used, rather than it just
discovering everything it can.  The aop.xml lists A and so only A is
applied even thought B is also in the jar.  Does that work for you
from the command line?  It may depend on whether you have an aop.xml
in the aspects jar - I'm not sure whether you do or not?

Andy

On 30 June 2010 13:33, Candy Chiu <candy.chiu.ad@xxxxxxxxx> wrote:
> How do I use -xmlConfigured in aspectj-maven-plugin?  Thanks.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


Back to the top