I just got down to this problem, it was my scenario: Here is my mojo config plugin:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.7</version> <configuration> <source>1.7</source> <target>1.7</target> <complianceLevel>1.7</complianceLevel> <verbose>true</verbose> </configuration> <executions> <execution> <goals> <goal>compile</goal> <goal>test-compile</goal> </goals> </execution> </executions> </plugin>
And my dependency on Aspectj:
<dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.8.5</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.5</version> </dependency>
When compiling (maven install), I notice this message:
[INFO] --- aspectj-maven-plugin:1.7:compile (default) @ com.wu.bishopframework --- Downloading: …aspectj/aspectjtools/1.8.2/aspectjtools-1.8.2.pom Downloaded: …aspectj/aspectjtools/1.8.2/aspectjtools-1.8.2.pom (1021 B at 2.3 KB/sec) Downloading: …aspectj/aspectjtools/1.8.2/aspectjtools-1.8.2.jar Downloaded: …aspectj/aspectjtools/1.8.2/aspectjtools-1.8.2.jar (10897 KB at 141.7 KB/sec) [INFO] No modifications found skipping aspectJ compile
Then I received this message:
[WARNING] bad version number found in C:\Users\mavargas\.m2\repository\org\aspectj\aspectjrt\1.8.5\aspectjrt-1.8.5.jar expected 1.8.2 found 1.8.5
The solution was simple, just add aspectjtools dependency inside the plugin, as shown below:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.7</version> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId> <version>1.8.5</version> </dependency> </dependencies> <configuration> <source>1.7</source> <target>1.7</target> <complianceLevel>1.7</complianceLevel> <verbose>true</verbose> </configuration> <executions> <execution> <goals> <goal>compile</goal> <goal>test-compile</goal> </goals> </execution> </executions> </plugin>
This fixed the problem.
Hope this helps someone cross in the same situation ...
source share