spring-boot-maven-plugin未指定版本导致编译错误-spring-boot-maven-plugin:3.0.0

报错

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.0:build-info (default) on project rjc-mana-common: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:3.0.0:build-info failed: Unable to load the mojo ‘build-info’ 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/BuildInfoMojo 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

原因

原因是maven在编译打包过程中没有指定spring-boot-maven-plugin的版本,默认会从nexus仓库中拉取最新的打包插件版本,而最新的3.0.0版本不被jdk8支持,无法执行编译。

查了下最新jar的最新版本日期:
在这里插入图片描述
应该是3.0.0刚出来不久

解决

需要用户在pom.xml文件中手动指定spring-boot-maven-plugin该插件的打包版本。

			<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!--增加版本号 -->
                <version>2.7.5</version>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                            <goal>build-info</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
根据提供的引用内容,我们可以得出以下结论: 在引用\[1\]中,报错信息显示未指定spring-boot-maven-plugin版本。在引用\[2\]中,报错信息显示spring-boot-maven-plugin版本3.0.0,但由于Java运行时的版本不兼容,导致加载插件失败。引用\[3\]提到spring-boot-maven-plugin是用于提供Spring Boot的Maven打包支持的插件。 根据提供的信息,我们无法确定spring-boot-maven-plugin是否支持JDK 1.7版本。然而,根据引用\[2\]中的错误信息,该插件至少需要Java运行时版本为52.0(对应Java 8)才能正常工作。因此,可以推断出spring-boot-maven-plugin不支持JDK 1.7版本。 综上所述,spring-boot-maven-plugin不支持JDK 1.7版本。如果您想使用该插件,您需要升级到JDK 1.8或更高版本。 #### 引用[.reference_title] - *1* [spring-boot-maven-plugin 3.0 版本打包失败](https://blog.csdn.net/xieqj_0511/article/details/128100166)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [spring-boot-maven-plugin未指定版本导致install 错误-spring-boot-maven-plugin:3.0.0](https://blog.csdn.net/qq_26898033/article/details/128369414)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [SpringBoot 插件 spring-boot-maven-plugin 原理,以及SpringBoo工程部署的 jar 包瘦身实战](https://blog.csdn.net/agonie201218/article/details/130842233)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

南巷Dong

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值