maven下載依賴(lài)失敗問(wèn)題及解決
前情提要
由于特殊原因,官方maven庫(kù)經(jīng)常連接失敗,所以很多maven都配置了阿里云的鏡像。
但是阿里云的鏡像里有很多依賴(lài)都沒(méi)有,這時(shí)候如果你的項(xiàng)目需要這些依賴(lài),就會(huì)導(dǎo)致編譯失敗。
1. 問(wèn)題1
描述:
This failure was cached in the local repository and resolution is not reattempted until the update interval of aliyunmaven has elapsed or updates are forced
詳細(xì):
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: windows
[INFO] os.detected.arch: x86_64
[INFO] os.detected.classifier: windows-x86_64
[INFO]
[INFO] -------< org.apache.pulsar:kafka-connect-avro-converter-shaded >--------
[INFO] Building Apache Pulsar :: Kafka Connect Avro Converter shaded 2.8.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.415 s
[INFO] Finished at: 2021-10-21T09:22:45+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project kafka-connect-avro-converter-shaded: Could not resolve dependencies for project org.apache.pulsar:kafka-connect-avro-converter-shaded:jar:2.8.0: Failed to collect dependencies at io.confluent:kafka-connect-avro-converter:jar:5.3.2: Failed to read artifact descriptor for io.confluent:kafka-connect-avro-converter:jar:5.3.2: io.confluent:kafka-schema-registry-parent:pom:5.3.2 was not found in https://maven.aliyun.com/repository/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of aliyunmaven has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
2. 問(wèn)題2
描述:
Could not find artifact io.confluent:kafka-connect-avro-converter:jar:5.3.2 in aliyunmaven
The POM for io.confluent:kafka-connect-avro-converter:jar:5.3.2 is missing, no dependency information available
詳細(xì):
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: windows
[INFO] os.detected.arch: x86_64
[INFO] os.detected.classifier: windows-x86_64
[INFO]
[INFO] -------< org.apache.pulsar:kafka-connect-avro-converter-shaded >--------
[INFO] Building Apache Pulsar :: Kafka Connect Avro Converter shaded 2.8.0
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for io.confluent:kafka-connect-avro-converter:jar:5.3.2 is missing, no dependency information available
Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/io/confluent/kafka-connect-avro-converter/5.3.2/kafka-connect-avro-converter-5.3.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.427 s
[INFO] Finished at: 2021-10-21T10:39:36+08:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "confluent" could not be activated because it does not exist.
[ERROR] Failed to execute goal on project kafka-connect-avro-converter-shaded: Could not resolve dependencies for project org.apache.pulsar:kafka-connect-avro-converter-shaded:jar:2.8.0: Could not find artifact io.confluent:kafka-connect-avro-converter:jar:5.3.2 in aliyunmaven (https://maven.aliyun.com/repository/public) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
3. 原因分析
雖然阿里云不存在這個(gè)jar包,但我們手動(dòng)放到了maven的本地庫(kù)中,重新打包后還是提示抄不到pom文件。
如下:
猜測(cè)可能是lastUpdate的問(wèn)題,但是刪除后仍然不能成功。
經(jīng)過(guò)各種嘗試,下面方法可行。
4. 解決辦法
刪除_remote.repositories和pom文件。
4.1 原始狀態(tài)
目錄文件:
錯(cuò)誤日志:
[WARNING] The requested profile "confluent" could not be activated because it does not exist.
[ERROR] Failed to execute goal on project kafka-connect-avro-converter-shaded: Could not resolve dependencies for project org.apache.pulsar:kafka-connect-avro-converter-shaded:jar:2.8.0: io.confluent:kafka-connect-avro-converter:jar:5.3.2 was not found in https://maven.aliyun.com/repository/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of aliyunmaven has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
4.2 刪除_remote.repositories
目錄結(jié)構(gòu):
錯(cuò)誤日志:
[WARNING] The requested profile "confluent" could not be activated because it does not exist.
[ERROR] Failed to execute goal on project kafka-connect-avro-converter-shaded: Could not resolve dependencies for project org.apache.pulsar:kafka-connect-avro-converter-shaded:jar:2.8.0: Failed to collect dependencies at io.confluent:kafka-connect-avro-converter:jar:5.3.2: Failed to read artifact descriptor for io.confluent:kafka-connect-avro-converter:jar:5.3.2: io.confluent:kafka-schema-registry-parent:pom:5.3.2 was not found in https://maven.aliyun.com/repository/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of aliyunmaven has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
4.3 刪除pom文件
目錄結(jié)構(gòu):
錯(cuò)誤日志:
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing F:\code\tmp\pulsar\kafka-connect-avro-converter-shaded\target\kafka-connect-avro-converter-shaded.jar with F:\code\tmp\pulsar\kafka-connect-avro-converter-shaded\target\kafka-connect-avro-converter-shaded-2.8.0-shaded.jar
[INFO] Dependency-reduced POM written at: F:\code\tmp\pulsar\kafka-connect-avro-converter-shaded\dependency-reduced-pom.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.882 s
[INFO] Finished at: 2021-10-21T16:21:55+08:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "confluent" could not be activated because it does not exist.
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
- 解決Maven依賴(lài)沖突的方法
- maven多模塊依賴(lài)版本不一致問(wèn)題解決
- idea?maven依賴(lài)引入失效無(wú)法正常導(dǎo)入依賴(lài)問(wèn)題的解決方法
- maven?解包依賴(lài)項(xiàng)中的文件的解決方法
- 如何兩步解決maven依賴(lài)導(dǎo)入失敗的問(wèn)題
- Maven導(dǎo)入依賴(lài)時(shí)爆紅的幾種解決方法
- 關(guān)于Maven依賴(lài)沖突解決之exclusions
- 基于Maven導(dǎo)入pom依賴(lài)很慢的解決方案
- 使用idea解決maven依賴(lài)沖突的問(wèn)題
- Maven導(dǎo)入依賴(lài)時(shí)報(bào)錯(cuò)如何解決
- Maven重復(fù)依賴(lài)問(wèn)題解決(同一個(gè)jar多個(gè)版本)
相關(guān)文章
SpringMVC實(shí)現(xiàn)數(shù)據(jù)綁定及表單標(biāo)簽
這篇文章主要為大家詳細(xì)介紹了SpringMVC實(shí)現(xiàn)數(shù)據(jù)綁定及表單標(biāo)簽的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-03-03java實(shí)現(xiàn)簡(jiǎn)單汽車(chē)租賃系統(tǒng)
這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)簡(jiǎn)單汽車(chē)租賃系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-01-01簡(jiǎn)單講解奇偶排序算法及在Java數(shù)組中的實(shí)現(xiàn)
這篇文章主要介紹了奇偶排序算法及Java數(shù)組的實(shí)現(xiàn),奇偶排序的時(shí)間復(fù)雜度為O(N^2),需要的朋友可以參考下2016-04-04Java獲取http和https協(xié)議返回的json數(shù)據(jù)
本篇文章主要介紹了Java獲取http和https協(xié)議返回的json數(shù)據(jù) ,本篇文章提供兩個(gè)方法,幫助各位如何獲取http和https返回的數(shù)據(jù)。有興趣的可以了解一下。2017-01-01SpringBoot集成mybatis連接oracle的圖文教程
這篇文章主要介紹了Spring Boot集成mybatis連接oracle的圖文教程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-02-02Java Swing最詳細(xì)基礎(chǔ)知識(shí)總結(jié)
這篇文章主要介紹了Java Swing最詳細(xì)基礎(chǔ)知識(shí)總結(jié),文中有非常詳細(xì)的代碼示例,對(duì)正在學(xué)習(xí)Java Swing的小伙伴們有很好的幫助,需要的朋友可以參考下2021-05-05idea中springboot項(xiàng)目連接數(shù)據(jù)庫(kù)報(bào)錯(cuò)的原因解析
這篇文章主要介紹了idea中springboot項(xiàng)目連接數(shù)據(jù)庫(kù)報(bào)錯(cuò)的原因解析,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-12-12詳解Java刪除Map中元素java.util.ConcurrentModificationException”異常解決
這篇文章主要介紹了詳解Java刪除Map中元素java.util.ConcurrentModificationException”異常解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-01-01淺談java String.split丟失結(jié)尾空字符串的問(wèn)題
下面小編就為大家?guī)?lái)一篇淺談java String.split丟失結(jié)尾空字符串的問(wèn)題。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-02-02