在本机安装maven后,在maven的settings.xml中更改profile,指定jdk
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
在IDEA中设置Maven:文件-设置-构建工具-maven
原文:https://www.cnblogs.com/sivanchan/p/13767725.html