maven 打包 提示:
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
原因
SpringBoot 3.0 发布,SpringBoot 3.0 最低支持 jdk17,所以这个 maven plugin 使用的也是最低 17 版本编译的
解决方案
pom 文件中指定 maven plugin 版本
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.3</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
```
本文介绍了在升级到Spring Boot 3.0后,由于最低JDK版本提升至17,如何通过调整`spring-boot-maven-plugin`的版本来解决Maven打包时的编译错误。解决方案是在`pom.xml`中明确指定插件的版本为2.7.3。
9474

被折叠的 条评论
为什么被折叠?



