maven项目update后jdk版本变为1.5

maven项目update后再IDE工具中显示的jdk版本可能会变成1.5的情况

需在pom文件中增加如下插件:

<!-- 添加项目jdk编译插件 -->
<build>
<plugins>
<!-- 设置编译版本为1.7 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>

猜你喜欢

转载自blog.csdn.net/yanghw117/article/details/78159969