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中內(nèi)存異常StackOverflowError與OutOfMemoryError詳解
這篇文章主要介紹了 Java中內(nèi)存異常StackOverflowError與OutOfMemoryError詳解的相關(guān)資料,需要的朋友可以參考下2017-03-03
在Java中將jsonObject轉(zhuǎn)換成對象的實現(xiàn)方法
在現(xiàn)代的Web開發(fā)中,JSON作為一種輕量級的數(shù)據(jù)交換格式,因其易讀性和易于解析的特點而被廣泛使用,本文將介紹如何在Java中將??jsonObject??轉(zhuǎn)換成Java對象,主要通過使用Gson庫來實現(xiàn)這一功能,需要的朋友可以參考下2025-04-04
運行Jar包出現(xiàn)提示xxx中沒有主清單屬性報錯問題解決方法
這篇文章主要介紹了運行Jar包出現(xiàn):xxx中沒有主清單屬性報錯,當(dāng)出現(xiàn)報錯:xxx中沒有主清單屬性,解決方法也很簡單,在pom.xml配置中,加上相應(yīng)配置即可,需要的朋友可以參考下2023-08-08

