Wednesday, July 15, 2009

Problem with AspectJ and Eclipse using maven

Having problems with AspectJ dependencies missing in the generated Eclipse .classpath file (mvn eclipse:eclipse) . The solution is to set:
ajdtVersion to "none"
Here is how to set it in the POM file:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<ajdtVersion>none</ajdtVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>org.thirdparty</groupId>
<artifactId>jar-containing-external-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<weaveDependencies>
<weaveDependency>
<groupId>org.mycompany</groupId>
<artifactId>jar-to-weave-with-aspects-in-this-library</artifactId>
</weaveDependency>
</weaveDependencies>
</configuration>
</plugin>

1 comment:

  1. You may want to look at this for some work around that we did to make AJDT work better with projects from Maven.

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=270554

    ReplyDelete