解决maven编译问题,诸如:ERROR:JAVA: 错误: 不支持发行版本 5,其根本是本地配置jdk和idea默认的jdk不匹配
1.在pom中添加配置
<properties>
<maven.compiler.source>13</maven.compiler.source>
<maven.compiler.target>13</maven.compiler.target>
</properties>
2.增加插件配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>13</source>
<target>13</target>
</configuration>
</plugin>
3.修改setting.xml
//进入settings.xml文件,找到profiles标签,加入以下代码
<profile>
<id>jdk-13</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>13</jdk>
</activation>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>13</maven.compiler.source>
<maven.compiler.target>13</maven.compiler.target>
</properties>
</profile>
原文:https://www.cnblogs.com/decoo/p/14833852.html