SpringBoot Maven RepackageMojo 打包失败原因()

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

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