2. I'm using XML file and I think that it is the right way, because you can change pointcuts without recompilation
1. I also have issues with packaging. I have to manually copy jboss-aop.xml file to the WEB-INF/classes/META-INF folder of my web application. I'm still looking for a better solution.
Any ideas on (1) anyone?
Oh, I just found out that there should be hassle to copy jbss-aop.xml
I'm just putting it into src/main/resources/META-INF/jboss-aop.xml and it gets copied into the right place during the package goal.
Don't forget to point jboss-aop maven plugin to its location:
Regarding your first question, you can do this to get an .aop module via maven, if you put it inside an .ear:
1) Create a standard .jar-module and put your jboss-aop.xml inside the META-INF directory.
2) In the pom-file where you assembe the ear do like this:
The <bundleFileName> tag will package the aop-jar.jar module as aop-jar.aop in the .ear.
I have only done this for .ear-modules, but you can always check if is is possible to do with the maven plugin for assembling .wars in case you want a .war archive
Thanks Andres for the update on this thread. Will try it out.
Do so. Please report any issues you run into!