解决Failed to execute goal org.apache.maven.plugins 错误,JDK版本不一致

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project cat-registry: Fatal error compiling: 无效的目标发行版: 1.8.0_111 -> [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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command

这个问题很明显是JDK1.8.0_111没有生效,版本不一致,我们系统当中,目前配置的JDK版本号是多少?

和我们的版本号是一致的,没有问题,然后去看项目使用的JDK是多少

解决Failed to execute goal org.apache.maven.plugins 错误,JDK版本不一致_第1张图片

从上图可以看到,目前项目用到的版本号不统一,我们把它们统一下。

集中定义版本号:

           
                org.apache.maven.plugins
                maven-compiler-plugin
                ${maven-compiler-plugin.version}
                
                    ${java.version}
                    ${java.version}
                    ${project.build.sourceEncoding}
                
            

如上设置好后再重新打包编译ok!

你可能感兴趣的:(DDUWEB)