Maven 1.x AspectJ Plugin

Add messageHolderClass property

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.2
  • Fix Version/s: 4.0
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    2

Description

from the iajc ant task documentation:

Specify a class to use as the message holder for the compile process. The entry must be a fully-qualified name of a class resolveable from the task classpath complying with the org.aspectj.bridge.IMessageHolder interface and having a public no-argument constructor.

Adding the ability to use a messageHolderClass requires two changes:
1) add maven.aspectj.messageHolderClass property and associated attribute messageHolderClass
2) add maven.dependency.classpath to the ant task def

Please see the attached file

  1. MPASPECTJ-19.txt
    25/Apr/05 2:25 AM
    0.9 kB
    Matt Smith
  2. MPASPECTJ-19-2.txt
    25/Apr/05 5:05 PM
    0.4 kB
    Matt Smith

Activity

Hide
Matt Smith added a comment -

messageHolderClass diff

Show
Matt Smith added a comment - messageHolderClass diff
Hide
Vincent Massol added a comment -

Thanks. Applied with several modifications:

  • it was missing a patch for properties.xml
  • it was missing a patch for changes.xml
  • the patch was probably invalid when no maven.aspectj.messageHolder property is specified. I hope I've fixed that.

It's also missing a test to prove that it works. Could you please provide one?

Note: I've noticed that the existing plugin test does not seem to fully work so it may need to be fixed too... Thanks!

Show
Vincent Massol added a comment - Thanks. Applied with several modifications:
  • it was missing a patch for properties.xml
  • it was missing a patch for changes.xml
  • the patch was probably invalid when no maven.aspectj.messageHolder property is specified. I hope I've fixed that.
It's also missing a test to prove that it works. Could you please provide one? Note: I've noticed that the existing plugin test does not seem to fully work so it may need to be fixed too... Thanks!
Hide
Matt Smith added a comment -

The paths in the argfile.lst needed to be changed from \ to /. The tests run successfully. I will add a test case for the previous patch. Thanks! Matt

Show
Matt Smith added a comment - The paths in the argfile.lst needed to be changed from \ to /. The tests run successfully. I will add a test case for the previous patch. Thanks! Matt
Hide
Vincent Massol added a comment -

Thanks Matt. I'm getting the following which does not sound right (but then I've not read the tests so this may be normal):

C:\dev\maven\maven-1\plugins\trunk\aspectj>maven plugin:test
__ __

\/ __ Apache_ ___
  \/ / ` \ V / -) ' \ ~ intelligent projects ~
_   _,_ _/___ _ _ v. 1.0.2

[warning] couldn't find aspectjrt.jar on classpath, checked: c:\apps\maven-1.0.2\lib\endorsed\xerces-2.4.0.jar;c:\apps\maven-1.0.2
\lib\endorsed\xml-apis-1.0.b2.jar;c:\j2sdk1.4.2_05\jre\lib\rt.jar;c:\j2sdk1.4.2_05\jre\lib\i18n.jar;c:\j2sdk1.4.2_05\jre\lib\sunrs
asign.jar;c:\j2sdk1.4.2_05\jre\lib\jsse.jar;c:\j2sdk1.4.2_05\jre\lib\jce.jar;c:\j2sdk1.4.2_05\jre\lib\charsets.jar;c:\j2sdk1.4.2_0
5\jre\classes;c:\j2sdk1.4.2_05\jre\lib\ext\dnsns.jar;c:\j2sdk1.4.2_05\jre\lib\ext\ldapsec.jar;c:\j2sdk1.4.2_05\jre\lib\ext\localed
ata.jar;c:\j2sdk1.4.2_05\jre\lib\ext\sunjce_provider.jar;C:\Documents and Settings\Vincent Massol\.maven\repository\aspectj\jars\a
spectjrt-1.2.jar;C:\Documents and Settings\Vincent Massol\.maven\repository\aspectj\jars\aspectjrt-1.2.1.jar;C:\dev\maven\maven-1\
plugins\trunk\aspectj\src\plugin-test\target\classes

C:\dev\maven\maven-1\plugins\trunk\aspectj\src\plugin-test\src\aspect\org\apache\maven\aspectj\Sample.aj:25 [warning] no match for
this type name: org.apache.maven.aspectj.AspectTest [Xlint:invalidAbsoluteTypeName]
execution(public * org.apache.maven.aspectj.AspectTest.someMethod());
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[warning] couldn't find aspectjrt.jar on classpath, checked: c:\apps\maven-1.0.2\lib\endorsed\xerces-2.4.0.jar;c:\apps\maven-1.0.2
\lib\endorsed\xml-apis-1.0.b2.jar;c:\j2sdk1.4.2_05\jre\lib\rt.jar;c:\j2sdk1.4.2_05\jre\lib\i18n.jar;c:\j2sdk1.4.2_05\jre\lib\sunrs
asign.jar;c:\j2sdk1.4.2_05\jre\lib\jsse.jar;c:\j2sdk1.4.2_05\jre\lib\jce.jar;c:\j2sdk1.4.2_05\jre\lib\charsets.jar;c:\j2sdk1.4.2_0
5\jre\classes;c:\j2sdk1.4.2_05\jre\lib\ext\dnsns.jar;c:\j2sdk1.4.2_05\jre\lib\ext\ldapsec.jar;c:\j2sdk1.4.2_05\jre\lib\ext\localed
ata.jar;c:\j2sdk1.4.2_05\jre\lib\ext\sunjce_provider.jar;C:\Documents and Settings\Vincent Massol\.maven\repository\aspectj\jars\a
spectjrt-1.2.jar;C:\Documents and Settings\Vincent Massol\.maven\repository\junit\jars\junit-3.8.1.jar;C:\Documents and Settings\V
incent Massol\.maven\repository\aspectj\jars\aspectjrt-1.2.1.jar;C:\dev\maven\maven-1\plugins\trunk\aspectj\src\plugin-test\target
\classes

The 1st and last warnings are ok (they are due to our aspectjrt.jar being named with a version and it seems the "aspectjrt.jar" name is hardcoded in AspectJ's code. Real ugly!). I'm concerned about the warning about "no match for...". Any idea?

Thanks

Show
Vincent Massol added a comment - Thanks Matt. I'm getting the following which does not sound right (but then I've not read the tests so this may be normal): C:\dev\maven\maven-1\plugins\trunk\aspectj>maven plugin:test __ __
\/ __ Apache_ ___
  \/ / ` \ V / -) ' \ ~ intelligent projects ~
_   _,_ _/___ _ _ v. 1.0.2
[warning] couldn't find aspectjrt.jar on classpath, checked: c:\apps\maven-1.0.2\lib\endorsed\xerces-2.4.0.jar;c:\apps\maven-1.0.2 \lib\endorsed\xml-apis-1.0.b2.jar;c:\j2sdk1.4.2_05\jre\lib\rt.jar;c:\j2sdk1.4.2_05\jre\lib\i18n.jar;c:\j2sdk1.4.2_05\jre\lib\sunrs asign.jar;c:\j2sdk1.4.2_05\jre\lib\jsse.jar;c:\j2sdk1.4.2_05\jre\lib\jce.jar;c:\j2sdk1.4.2_05\jre\lib\charsets.jar;c:\j2sdk1.4.2_0 5\jre\classes;c:\j2sdk1.4.2_05\jre\lib\ext\dnsns.jar;c:\j2sdk1.4.2_05\jre\lib\ext\ldapsec.jar;c:\j2sdk1.4.2_05\jre\lib\ext\localed ata.jar;c:\j2sdk1.4.2_05\jre\lib\ext\sunjce_provider.jar;C:\Documents and Settings\Vincent Massol\.maven\repository\aspectj\jars\a spectjrt-1.2.jar;C:\Documents and Settings\Vincent Massol\.maven\repository\aspectj\jars\aspectjrt-1.2.1.jar;C:\dev\maven\maven-1\ plugins\trunk\aspectj\src\plugin-test\target\classes C:\dev\maven\maven-1\plugins\trunk\aspectj\src\plugin-test\src\aspect\org\apache\maven\aspectj\Sample.aj:25 [warning] no match for this type name: org.apache.maven.aspectj.AspectTest [Xlint:invalidAbsoluteTypeName] execution(public * org.apache.maven.aspectj.AspectTest.someMethod()); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [warning] couldn't find aspectjrt.jar on classpath, checked: c:\apps\maven-1.0.2\lib\endorsed\xerces-2.4.0.jar;c:\apps\maven-1.0.2 \lib\endorsed\xml-apis-1.0.b2.jar;c:\j2sdk1.4.2_05\jre\lib\rt.jar;c:\j2sdk1.4.2_05\jre\lib\i18n.jar;c:\j2sdk1.4.2_05\jre\lib\sunrs asign.jar;c:\j2sdk1.4.2_05\jre\lib\jsse.jar;c:\j2sdk1.4.2_05\jre\lib\jce.jar;c:\j2sdk1.4.2_05\jre\lib\charsets.jar;c:\j2sdk1.4.2_0 5\jre\classes;c:\j2sdk1.4.2_05\jre\lib\ext\dnsns.jar;c:\j2sdk1.4.2_05\jre\lib\ext\ldapsec.jar;c:\j2sdk1.4.2_05\jre\lib\ext\localed ata.jar;c:\j2sdk1.4.2_05\jre\lib\ext\sunjce_provider.jar;C:\Documents and Settings\Vincent Massol\.maven\repository\aspectj\jars\a spectjrt-1.2.jar;C:\Documents and Settings\Vincent Massol\.maven\repository\junit\jars\junit-3.8.1.jar;C:\Documents and Settings\V incent Massol\.maven\repository\aspectj\jars\aspectjrt-1.2.1.jar;C:\dev\maven\maven-1\plugins\trunk\aspectj\src\plugin-test\target \classes The 1st and last warnings are ok (they are due to our aspectjrt.jar being named with a version and it seems the "aspectjrt.jar" name is hardcoded in AspectJ's code. Real ugly!). I'm concerned about the warning about "no match for...". Any idea? Thanks
Hide
Matt Smith added a comment -

Here is what I think is going on. When aspecj:compile goal is executed the AspectTest is not visible. It is only visible when the maven.test.compile.src.set during the aspectj:test-compile. Thus you get the warning. Sample.aj is referencing classes (Dummy and AspectTest) from the sourceDirectory and the test directory. Does that make since or am I off track.

Show
Matt Smith added a comment - Here is what I think is going on. When aspecj:compile goal is executed the AspectTest is not visible. It is only visible when the maven.test.compile.src.set during the aspectj:test-compile. Thus you get the warning. Sample.aj is referencing classes (Dummy and AspectTest) from the sourceDirectory and the test directory. Does that make since or am I off track.
Hide
Lukas Theussl added a comment -

Fixed a while ago.

Show
Lukas Theussl added a comment - Fixed a while ago.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: