Maven中Could not find artifact XXXX的錯(cuò)誤解決
我目前碰到的是:
Could not find artifact com.alibaba.cloud:spring-cloud-alibaba-dependencies:pom:2.1.0 RELEASE in central
出現(xiàn)問(wèn)題的原因其實(shí)很簡(jiǎn)單,寫(xiě)錯(cuò)了版本號(hào)??!2.1.0 RELEASE中間不該是空格而應(yīng)該是.,即應(yīng)該寫(xiě)成如下:
<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依賴時(shí),可在父類pom進(jìn)行指定應(yīng)該如下:
<!-- 子模塊繼承后,提供作用:鎖定版本 + 子module不用寫(xiě)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>
以上三個(gè)依賴基本都是在一起的,其中版本號(hào)自行制定即可,但一定不要寫(xiě)錯(cuò)了,不然后期很麻煩!
到此這篇關(guān)于Maven中Could not find artifact XXXX的錯(cuò)誤解決的文章就介紹到這了,更多相關(guān)Maven Could not find artifact內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
java開(kāi)發(fā)使用BigDecimal避坑四則
這篇文章主要為大家介紹了java開(kāi)發(fā)使用BigDecimal的避坑四則,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-07-07
淺談Spring Boot 2.0遷移指南主要注意點(diǎn)
Spring官方的Spring Boot 2變動(dòng)指南,主要是幫助您將應(yīng)用程序遷移到Spring Boot 2.0,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-10-10
Java中內(nèi)存異常StackOverflowError與OutOfMemoryError詳解
這篇文章主要介紹了 Java中內(nèi)存異常StackOverflowError與OutOfMemoryError詳解的相關(guān)資料,需要的朋友可以參考下2017-03-03
在Java中將jsonObject轉(zhuǎn)換成對(duì)象的實(shí)現(xiàn)方法
在現(xiàn)代的Web開(kāi)發(fā)中,JSON作為一種輕量級(jí)的數(shù)據(jù)交換格式,因其易讀性和易于解析的特點(diǎn)而被廣泛使用,本文將介紹如何在Java中將??jsonObject??轉(zhuǎn)換成Java對(duì)象,主要通過(guò)使用Gson庫(kù)來(lái)實(shí)現(xiàn)這一功能,需要的朋友可以參考下2025-04-04
SpringBoot前后端接口對(duì)接常見(jiàn)錯(cuò)誤小結(jié)
SpringBoot前后端接口對(duì)接工作時(shí),經(jīng)常遇到請(qǐng)求500,400等問(wèn)題,本文主要介紹了SpringBoot前后端接口對(duì)接常見(jiàn)錯(cuò)誤小結(jié),感興趣的可以了解一下2022-01-01
運(yùn)行Jar包出現(xiàn)提示xxx中沒(méi)有主清單屬性報(bào)錯(cuò)問(wèn)題解決方法
這篇文章主要介紹了運(yùn)行Jar包出現(xiàn):xxx中沒(méi)有主清單屬性報(bào)錯(cuò),當(dāng)出現(xiàn)報(bào)錯(cuò):xxx中沒(méi)有主清單屬性,解決方法也很簡(jiǎn)單,在pom.xml配置中,加上相應(yīng)配置即可,需要的朋友可以參考下2023-08-08

