若依微服务打包system服务报错,[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.0:repackage (default) on project ruoyi-gateway: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:3.0.0:repackage failed: Unable to load the mojo 'repackage' in the plugin 'org.springframework.boot:spring-boot-maven-plugin:3.0.0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/springframework/boot/maven/RepackageMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.springframework.boot:spring-boot-maven-plugin:3.0.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/depository/m2/org/springframework/boot/spring-boot-maven-plugin/3.0.0/spring-boot-maven-plugin-3.0.0.jar
[ERROR] urls[1] = file:/D:/depository/m2/org/springframework/spring-context/6.0.2/spring-context-6.0.2.jar
[ERROR] urls[2] = file:/D:/depository/m2/org/springframework/spring-aop/6.0.2/spring-aop-6.0.2.jar

首先排查的是JDK版本是否一致问题,后面发现都是一致的,后面在搜索

<spring-boot.version>2.7.5</spring-boot.version>

发现版本跟上面不一致,就修改成一致,后面发现还是不行,继续看报错上面的发现在ruoyi-auth就报错了,打开POM发现报错的是内容有goal所以试着把这段注释,结果成功了

[INFO] ruoyi-api .......................................... SUCCESS [  0.021 s]
[INFO] ruoyi-api-system ................................... SUCCESS [  0.133 s]
[INFO] ruoyi-common-redis ................................. SUCCESS [  0.243 s]
[INFO] ruoyi-common-security .............................. SUCCESS [  0.266 s]
[INFO] ruoyi-auth ......................................... SUCCESS [  0.519 s]
[INFO] ruoyi-gateway ...................................... FAILURE [  9.949 s]
[INFO] ruoyi-visual ....................................... SKIPPED
[INFO] ruoyi-visual-monitor ............................... SKIPPED
[INFO] ruoyi-common-datasource ............................ SKIPPED
[INFO] ruoyi-common-datascope ............................. SKIPPED
 <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
               <!-- <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>-->
            </plugin>
        </plugins>
    </build>

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值