java - AspectJ compiler doesn compile *.aj files -
i have following project:
root |---pom.xml src/main/java |---com.package |----app.java src/main/aspects |---com.package |----trace.aj
now, pom.xml is
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.package</groupid> <artifactid>aspectj-test</artifactid> <packaging>jar</packaging> <version>1.0-snapshot</version> <name>aspectj-test</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupid>org.aspectj</groupid> <artifactid>aspectjrt</artifactid> <version>1.8.2</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>aspectj-maven-plugin</artifactid> <version>1.7</version> <executions> <execution> <id>compile</id> <configuration> <ajdtbuilddeffile>build.ajproperties</ajdtbuilddeffile> </configuration> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
after executing mvn aspectj:compile
got app.class
compiled class, didn't trace.class
. what's wrong that?
by default aspectj-maven-plugin expects aspects in directory src/main/aspect
. if want store them in different directory, have specify configuration:
<configuration> <aspectdirectory>src/main/aspects</aspectdirectory> </configuration>
Comments
Post a Comment