我正在尝试编译我最近升级到 Java 8 的项目。
现在我开始使用 Java 8 的特定功能,我发现自己在 aspectj-maven-plugin 上遇到了异常。Eclipse 中的编译和 Maven 中的正常编译工作正常。
[ERROR] The import java.util.stream cannot be resolved
/Users/Shared/java/projects/msa/platform/core/src/main/java/nl/project/social/SomeClass.java:6
import java.util.stream.Collectors;
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.5</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.8.5</version>
</dependency>
</dependencies>
<configuration>
<complianceLevel>1.8</complianceLevel>
<source>1.8</source>
<target>1.8</target>
<verbose>false</verbose>
<outxml>true</outxml>
<encoding>UTF-8</encoding>
<showWeaveInfo>true</showWeaveInfo>
<forceAjcCompile>true</forceAjcCompile>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
我使用 Spring 4.1.x 和 jdk1.8.0_31
有什么建议么?