Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin 不支持发行版本

问题描述

今天在导入thymeleaf官网上的example项目时,在导入项目后clean,之后mvn compile出现问题。
项目地址:
https://github.com/thymeleaf/thymeleafexamples-gtvg

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project gtvg: Fatal error compilin
g: 错误: 不支持发行版本 6 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

错误提示

问题所在:

项目中pom.xml设置的 java即jdk版本不支持该插件 org.apache.maven.plugins:maven-compiler-plugin:3.8.1

解决办法:

更改pom.xml中java版本
初始:

<properties>
    <java.version>6</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    <project.build.sourceEncoding>US-ASCII</project.build.sourceEncoding>
    <thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
  </properties>

更改为

<properties>
    <java.version>11</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    <project.build.sourceEncoding>US-ASCII</project.build.sourceEncoding>
    <thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
  </properties> 

更改这个地方即可:<java.version>11</java.version>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值