美文网首页
解决Failed to execute goal org.apa

解决Failed to execute goal org.apa

作者: 墨迹嘿嘿 | 来源:发表于2020-05-09 17:19 被阅读0次
    image
    [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版本号是多少?

    image

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

    image image

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

    集中定义版本号:

    image
               <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
    

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

    相关文章

      网友评论

          本文标题:解决Failed to execute goal org.apa

          本文链接:https://www.haomeiwen.com/subject/egtlnhtx.html