Community
Participate
Working Groups
Currently the property: org.aspectj.weaver.loadtime.configuration can be set to name the ltw configuration file that the loadtime weaver searches for. The default value is: META-INF/aop.xml;META-INF/aop-ajc.xml;org/aspectj/aop.xml and the weaver searches the classpath for .xml files matching any of those three possibilities. A typical override might therefore be: -Dorg.aspectj.weaver.loadtime.configuration=META-INF/overhere.xml however the weaver will still only look for it on the classpath. In some environments the ltw user may just want to name the aop config file to use, and not be forced to include it on the classpath. We have had the suggestion to make it protocol based, which i like, but for now I would just allow support for 'file:'. If file: is the prefix, it will be treated as direct reference to the file to use, otherwise it will be searched for. This change would mean all existing uses of the override will be fine, but new users will be all to exploit the flexibility of naming their configuration directly.
Created attachment 105948 [details] Patch for loadtime module This patch to loadtime introduces the behaviour discussed. The configuration option now supports 'file:' prefixed references directly to files that do not have to be on the classpath. The configuration parameter is still a semi-colon separate list however. So all these work: aj5 -Dorg.aspectj.weaver.loadtime.configuration=file:c:\aspectj161-dev\doc\examples\someotherplace\foo.xml HelloWorld aj5 -Dorg.aspectj.weaver.loadtime.configuration=file:../someotherplace/foo.xml HelloWorld aj5 -Dorg.aspectj.weaver.loadtime.configuration=file:c:\aspectj161-dev\doc\examples\someotherplace\foo.xml;aop.xml HelloWorld In the final case the foo.xml will be loaded directly and then aop.xml will be searched for on the classpath.
enhancement committed - will be in 1.6.2