我们在IDEA中创建Maven工程师发现JDK的默认版本总是1.5 这总是需要我们去修改 我们可以直接修改maven的配置文件一次性解决
配置Maven工程的基础JDK版本
如果按照默认配置进行,Java工程使用的默认Jdk版本为1.5;
在settings.xml文件中配置profiles标签 配置默认版本为1.8
<profiles>
<id>jdk1.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>
</profiles>