<project>
<!-- ... -->
<dependencies>
<!-- ... -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectjVersion}</version>
</dependency>
<!-- ... -->
</dependencies>
<!-- ... -->
<build>
<plugins>
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<ajdtBuildDefFile>build.ajproperties</ajdtBuildDefFile>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- ... -->
</plugins>
</build>
<!-- ... -->
</project>
Using with AJDT
Using together with AJDT
To use this plugin together with AJDT (AspectJ Development Tools for Eclipse IDE), you simply specify the
ajdtBuildDefFile
property to point to the build.ajproperties
file generated by AJDT. The use of this property
overrides the configured project source folders. Any include or exclude elements in the POM are also disregarded.
Example of a valid build properties file
Note: In this file, the paths are relative to the project’s base directory.
src.includes = src/main/aspect,\ src/main/java/com/mycompany/myaspects/**/*TransactionAspect.java src.excludes = src/main/java/org/codehaus/mojo/aspectj/Azpect.java