zoukankan      html  css  js  c++  java
  • 解决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是多少

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

    集中定义版本号:

               <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>
    

      

  • 相关阅读:
    Leetcode字符串算法
    Leetcode基础算法结构-目录结构
    python日志-loguru日志管理
    FastApi
    python-hashlib
    excel数据操作
    yagmail自动发邮件
    python-sys
    集合
    文件操作
  • 原文地址:https://www.cnblogs.com/zhaixingzhu/p/12859006.html
Copyright © 2011-2022 走看看