Я пытаюсь использовать aspectj-maven-plugin
в проекте maven.Во время компиляции я получаю:
Syntax error, annotations are only available if source level is 5.0
Syntax error, annotations are only available if source level is 5.0
Syntax error, annotations are only available if source level is 5.0
Тем не менее, я устанавливаю следующее в своем файле pom.xml:
<project.build.source>1.6</project.build.source>
<project.build.target>1.6</project.build.target>
У меня есть некоторые зависимости:
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.11</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.4</version>
</dependency>
Как мне решить эту проблему?Спасибо.
Решение
Я добавил следующее в свой pom.xml, и теперь оно работает:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
<configuration>
<source>${project.build.source}</source> <- Addition
<target>${project.build.target}</target> <- Addition
</configuration>
</execution>
</executions>
</plugin>