springboot maven打包一直失败


问题描述:

  

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,没有指定会直接扫描所有的包,有多个会报错,烦死了-->


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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM