问题
Is there a way to specify the name of the aop.xml file with LTW? or define another name and location? I have several software modules that I use and that all use META-INF/aop.xml with different settings. I include these modules in a web application and then it all dependens how it's deployed/unpacked, which aop.xml file is used .. So I discovered after long time of searching that not all LTW weaving toke place correcting as it depends with aop.xml was used ...
Basically I need to use both aop.xml files, kinda of merging both contents of the aop.xml files...
How to do this? Ed
回答1:
When using AspectJ you can use the system property org.aspectj.weaver.loadtime.configuration
to point to another config file. For example:
-D org.aspectj.weaver.loadtime.configuration=META-INF/myaop.xml
回答2:
Duplicate of Load time weaving in AspectJ using aop.xml.
Furthermore, the AspectJ documentation says:
When several configuration files are visible from a given weaving class loader their contents are conceptually merged.
来源:https://stackoverflow.com/questions/3736860/aop-xml-name-and-location