springboot maven打包一直失败

解决Spring Boot项目POM导入问题
本文描述了一个Spring Boot项目中遇到的POM导入问题,即无法找到org.springframework:spring-framework-bom:pom:3.1.1.RELEASE。通过调整spring.version属性并去除特定配置,成功解决了问题,避免了版本冲突。

问题描述:

  

Non-resolvable import POM: Failure to find org.springframework:spring-framework-bom:pom:3.1.1.RELEASE in http://maven.aliyun.com/nexus/content/repositories/central/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced @ org.springframework.boot:spring-boot-dependencies:2.1.0.RELEASE, C:\Users\111\.m2\repository\org\springframework\boot\spring-boot-dependencies\2.1.0.RELEASE\spring-boot-dependencies-2.1.0.RELEASE.pom, line 2669, column 25

问题的意思是不能导入org.springframework:spring-framework-bom:pom:3.1.1.RELEASE

一直以为是自己的pom文件结构出问题了,甚至还想到是不是setting文件出问题了,后面试了其他的项目都行,唯独这个项目不行应该不是setting文件的问题,

去除:

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
</parent>
就可以,但是我就是要这个啊,怎么会出问题呢??
于是一直找。。。。。没找到类似的问题
突然在想:org.springframework:spring-framework-bom:pom:3.1.1.RELEASE 这个pom我没用到啊,而且版本应该是2.1.0,
所以搜了一下3.1.1.RELEASE
发现了定义
资源时有个这个
<spring.version>3.1.1.RELEASE</spring.version>

去除之后,发现可以打包。
所以猜测:虽然parent引入的是2.1.0版本,但是spring.version是个特殊的属性,会覆盖parent的版本。


补充一下:
<!--使用springboot的插件一定要指定main,没有指定会直接扫描所有的包,有多个会报错,烦死了-->


请路过的大神指正一下,是不是这个理解的

转载于:https://www.cnblogs.com/lbs-171222/p/10437848.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值