Bug 238666 - Allow the ltw configuration to be directly specified rather than discovered on the classpath
Summary: Allow the ltw configuration to be directly specified rather than discovered o...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: 1.6.2   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-26 15:05 EDT by Andrew Clement CLA
Modified: 2008-08-06 14:13 EDT (History)
1 user (show)

See Also:


Attachments
Patch for loadtime module (3.24 KB, patch)
2008-06-26 15:57 EDT, Andrew Clement CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2008-06-26 15:05:26 EDT
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.
Comment 1 Andrew Clement CLA 2008-06-26 15:57:45 EDT
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.
Comment 2 Andrew Clement CLA 2008-08-06 14:13:27 EDT
enhancement committed - will be in 1.6.2