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