Maven中Could not find artifact XXXX的錯誤解決
我目前碰到的是:
Could not find artifact com.alibaba.cloud:spring-cloud-alibaba-dependencies:pom:2.1.0 RELEASE in central
出現(xiàn)問題的原因其實很簡單,寫錯了版本號??!2.1.0 RELEASE中間不該是空格而應(yīng)該是.,即應(yīng)該寫成如下:
<dependencyManagement> ? ? <dependencies> ? ? ? <!-- spring cloud alibaba 2.1.0.RELEASE--> ? ? ? <dependency> ? ? ? ? <groupId>com.alibaba.cloud</groupId> ? ? ? ? <artifactId>spring-cloud-alibaba-dependencies</artifactId> ? ? ? ? <version>2.1.0.RELEASE</version> ? ? ? ? <type>pom</type> ? ? ? ? <scope>import</scope> ? ? ? </dependency>
在Maven引入alibaba.cloud依賴時,可在父類pom進(jìn)行指定應(yīng)該如下:
<!-- 子模塊繼承后,提供作用:鎖定版本 + 子module不用寫groupId和version--> ? <dependencyManagement> ? ? <dependencies> ? ? ? <!-- springBoot 2.2.2 --> ? ? ? <dependency> ? ? ? ? <groupId>org.springframework.boot</groupId> ? ? ? ? <artifactId>spring-boot-dependencies</artifactId> ? ? ? ? <version>2.2.2.RELEASE</version> ? ? ? ? <type>pom</type> ? ? ? ? <scope>import</scope> ? ? ? </dependency> ? ? ? <!-- spring cloud Hoxton.SR1 --> ? ? ? <dependency> ? ? ? ? <groupId>org.springframework.cloud</groupId> ? ? ? ? <artifactId>spring-cloud-dependencies</artifactId> ? ? ? ? <version>Hoxton.SR1</version> ? ? ? ? <type>pom</type> ? ? ? ? <scope>import</scope> ? ? ? </dependency> ? ? ?? ? ? ? <!-- spring cloud alibaba 2.1.0.RELEASE--> ? ? ? <dependency> ? ? ? ? <groupId>com.alibaba.cloud</groupId> ? ? ? ? <artifactId>spring-cloud-alibaba-dependencies</artifactId> ? ? ? ? <version>2.1.0.RELEASE</version> ? ? ? ? <type>pom</type> ? ? ? ? <scope>import</scope> ? ? ? </dependency> ? </dependencyManagement>
以上三個依賴基本都是在一起的,其中版本號自行制定即可,但一定不要寫錯了,不然后期很麻煩!
到此這篇關(guān)于Maven中Could not find artifact XXXX的錯誤解決的文章就介紹到這了,更多相關(guān)Maven Could not find artifact內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
解析Java實現(xiàn)設(shè)計模式六大原則之里氏替換原則
里氏替換原則是用來幫助我們在繼承關(guān)系中進(jìn)行父子類的設(shè)計。它闡述了有關(guān)繼承的一些原則,也就是什么時候應(yīng)該使用繼承,什么時候不應(yīng)該使用繼承,以及其中蘊(yùn)含的原理。它是繼承復(fù)用的基礎(chǔ),反映了基類與子類之間的關(guān)系,是對開閉原則的補(bǔ)充,對實現(xiàn)抽象化具體步驟的規(guī)范2021-06-06Spring Boot 配置 IDEA和DevTools 熱部署的方法
這篇文章主要介紹了Spring Boot 配置 IDEA和DevTools 熱部署的方法,需要的朋友可以參考下2018-02-02SpringBoot MongoDB與MongoDB GridFS基本使用
這篇文章主要為大家介紹了SpringBoot MongoDB與MongoDB GridFS基本使用示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-07-07Java中的關(guān)鍵字_動力節(jié)點Java學(xué)院整理
關(guān)鍵字也稱為保留字,是指Java語言中規(guī)定了特定含義的標(biāo)示符。對于保留字,用戶只能按照系統(tǒng)規(guī)定的方式使用,不能自行定義2017-04-04使用Java7的Files工具類和Path接口來訪問文件的方法
下面小編就為大家分享一篇使用Java7的Files工具類和Path接口來訪問文件的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2017-11-11