idea中在我们使用jdk1.8的过程中,总是在maven中插入新依赖的时候出现报错提示,即自动将Language Level 8重置为5。如下图所示:
解决方案:
只要在pom.xml 中添加如下内容,指定编译的源码和目标版本为1.8;
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>