7 date: "2014-07-18T10:36:19+00:00"
8 guid: http://juplo.de/?p=306
11 title: Running aspectj-maven-plugin with the current Version 1.8.1 of AspectJ
12 url: /running-aspectj-maven-plugin-with-the-current-version-1-8-1-of-aspectj/
15 Lately, I stumbled over a syntactically valid class, that [can not be compiled by the aspectj-maven-plugin](/aspectj-maven-plugin-can-not-compile-valid-java-7-0-code/ "Read more about the code, that triggers the AspectJ compilation error"), even so it is a valid Java-7.0 class.
17 Using the current version ( [Version 1.8.1](http://search.maven.org/#artifactdetails|org.aspectj|aspectjtools|1.8.1|jar "See informations about the current version 1.8.1 of AspectJ on Maven Central")) of [AspectJ](http://www.eclipse.org/aspectj/ "Visit the homepage of the AspectJ-project") solves this issue.
18 But unfortunatly, there is no new version of the [aspectj-maven-plugin](http://mojo.codehaus.org/aspectj-maven-plugin/ "Learn more about the aspectj-maven-plugin") available, that uses this new version of AspectJ.
19 [The last version of the aspectj-maven-plugin](http://search.maven.org/#artifactdetails|org.codehaus.mojo|aspectj-maven-plugin|1.6|maven-plugin "Read more informations about the latest version of the aspectj-maven-plugin on Maven Central") was released to Maven Central on December the 4th 2013 and this versions is bundeled with the version 1.7.2 of AspectJ.
21 The simple solution is, to bring the aspectj-maven-plugin to use the current version of AspectJ.
22 This can be done, by overwriting its dependency to the bundled aspectj.
23 This definition of the plugin does the trick:
28 <groupId>org.codehaus.mojo</groupId>
29 <artifactId>aspectj-maven-plugin</artifactId>
30 <version>1.6</version>
32 <complianceLevel>1.7</complianceLevel>
35 <groupId>org.springframework</groupId>
36 <artifactId>spring-aspects</artifactId>
49 <groupId>org.aspectj</groupId>
50 <artifactId>aspectjtools</artifactId>
51 <version>1.8.1</version>
58 The crucial part is the explicit dependency, the rest depends on your project and might have to be adjusted accordingly:
64 <groupId>org.aspectj</groupId>
65 <artifactId>aspectjtools</artifactId>
66 <version>1.8.1</version>
72 I hope, that helps, folks!