cmd中运行maven项目出现
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Hello: Fatal error compiling: 无效的目标发行版: 10 -> [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中添加如下配置代码:
但是执行mvn install时又出现以下错误:(但是结果可以运行成功)
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project HelloThere are test failures.

Maven项目编译错误解决方案
本文详细介绍了在cmd中运行Maven项目时遇到的编译错误:目标发行版无效的问题,提供了在pom.xml中调整JDK版本的配置方法,并分享了删除repository后重新安装、clean和install的操作步骤。

被折叠的 条评论
为什么被折叠?



