I'm trying to use the aspectj-maven-plugin but I'm hitting some odd issues.
Here is how the plugin is configured:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<verbose>true</verbose>
<showWeaveInfo>true</showWeaveInfo>
<source>1.5</source>
<target>1.5</target>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<includes>
<include>**/ContentUrlConverter.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
When I run 'mvn compile' it seems to be trying to weave the right class, but
it fails to compile the class with very basic compilation errors. Basically,
it can't see any of the other classes in my project. Here's an example of
the compilation errors:
----------------------
[ERROR] The import com.ptc.fusion.settings cannot be resolved
[ERROR] The import com.ptc.fusion.model cannot be resolved
[ERROR] ContentSettings cannot be resolved to a type
[ERROR] LocalizedString cannot be resolved to a type
[ERROR] LocalizedString cannot be resolved to a type
[ERROR] contentSettings cannot be resolved
[ERROR] ContentSettings cannot be resolved to a type
[ERROR] contentSettings cannot be resolved or is not a field
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Compiler errors :
error at import com.ptc.fusion.settings.ContentSettings;
^^^^^^^^^^^^^^^^^^^^^^
/home/mwelch/projects/fusion/project/fusion-service/src/main/java/com/ptc/fusion/compass/ContentUrlConverter.java:25:0::0
The import com.ptc.fusion.settings cannot be resolved
error at import com.ptc.fusion.model.learningitem.LocalizedString;
^^^^^^^^^^^^^^^^^^^
/home/mwelch/projects/fusion/project/fusion-service/src/main/java/com/ptc/fusion/compass/ContentUrlConverter.java:26:0::0
The import com.ptc.fusion.model cannot be resolved
error at private ContentSettings contentSettings;
----------------------
Basically, the aspectj weaver can't seem to see ANY of the other classes in
my project. That doesn't really make any sense. If I change the <include>
pattern to be "**/*.java" then the weaver works ok. Unfortunately, this
causes some other problems. The bottom line is that I don't want to include
all of the files in my project for weaving.
I notice that the maven process isn't attempting to run the normal "compile"
goal until after the aspectj compilation goal. Is that what it's supposed to
be doing? Is the reason aspectj can't see any of the other classes in my
project because they haven't been compiled yet? Why would it run int hat
order then?
For what it's worth, if I do the load time weaving (using a META-INF/aop.xml
config that's functionally identical to how I have the plugin configured in
maven) , then everything works fine.
Any idea what might be going on?
--
View this message in context:
http://www.nabble.com/aspectj-plugin-not-weaving-tf4107688.html#a11681046
Sent from the mojo - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email