In the Lib that has the aspect, add this to the pom.xml
<!-- AspecJ Compile -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<outxml>true</outxml>
<showWeaveInfo>true</showWeaveInfo>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- /AspecJ Compile -->
.....
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.7</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.7</version>
</dependency>
Then, on the application that receive the aspect, need to have the failOnError:false to allow the mvn compiler to continue. Then, we weave the dependency “LibWithSomeAspects” in.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<!-- Temporary fix for supporting aspectJ -->
<failOnError>false</failOnError>
</configuration>
</plugin>
<!-- AspecJ Compile -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<outxml>true</outxml>
<showWeaveInfo>true</showWeaveInfo>
<verbose>true</verbose>
<weaveDependencies>
<weaveDependency>
<groupId>com.example</groupId>
<artifactId>LibWithSomeAspects</artifactId>
</weaveDependency>
</weaveDependencies>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- /AspecJ Compile -->