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