I am trying to create a custom aspectj annotation. I have following in pom:
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.9.5</version>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.11</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
I get following error on running 'mvn clean install':
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile (default) on project AspectTest: AJC compiler errors:
[ERROR] error at @Aspect
[ERROR] ^^^^^^
[ERROR] .....\MyMethodPerformanceAspect.java:7:0::0 Syntax error, annotations are only available
if source level is 1.5 or greater
MyMethodPerformanceAspect is my annotation definition class.
I have jdk 8 in the system. I am using intellij, with compiler level and source level set to 8.