I haven't done a lot of experimentation here, so please have patience. What I think you can do is put stuff in a .sar file or directory as follows:
myapplication.sar/ metadata1-aop.xml metadata2-aop.xml myweb.war
Read these as well:
Instead of putting stuff in the web-inf/lib directory, have this structure:
myapplication.sar/ mylibrary.aop/ com/mycompany/Foo.class.... META-INF/jboss-aop.xml mylibrary2.aop/ com/mycompany/Bar.class.... META-INF/jboss-aop.xml myweb.war
Get back to me with problems. Hey, if you're interested, could you possibly write up some of your experiences with packaging on our WIKI? A HOWTO or something?
With JBoss AOP beta2 release you will also be able to embed metadata as annotations within .class files. The annotations are binary compatible with JDK 1.5 annotations. JBoss AOP beta2 release will be may 4th or 5th.
My problem is I'm using JBossAOP in a standalone mode, note with the JBoss application server. But if I can find a (not too ugly) way to package everything, I'll be happy to explain it in a 'how to'.
But if you have any other suggestion, I'd be happy to experiment. Moving to JDK 1.5 just for annotations doesn't really seduce me.
Ok, I will expand the jboss.aop.path System property variable to accept directories and load any XML file that has the form *-aop.xml.
Other than that, do take a look at the packaging example in the JBoss AOP beta distribution. This solution works with standalone, but resolves XML files by classloader.getResources("META-INF/jboss-aop.xml") only.
FYI, beta2 will have an annotation compiler for JDK 1.4 so that you can use annotations within JDK 1.4.