設定倉庫鏡像為阿里云的倉庫,然后我通過springboot官網創建了一個專案,然后用idea打開,怎么這么多jar包匯入不了啊?不是應該自動從阿里云倉庫搜索到嗎?我在阿里云倉庫里面能搜索到相關的jar包啊?



uj5u.com熱心網友回復:
是不是因為路徑有中文字符的原因uj5u.com熱心網友回復:
settings檔案中嗎?我從網上粘貼下來的。也嘗試過好幾個;
專案檔案的話直接從springboot官網quickstart直接創建的,應該不會。
uj5u.com熱心網友回復:
我說的你你那個超超。。uj5u.com熱心網友回復:
哦哦,有可能,我改一下試試




uj5u.com熱心網友回復:
我嘗試改了下xml檔案位置,然后reimport,還是進行下載
uj5u.com熱心網友回復:
那個parent標簽應該放在dependencies標簽的外面uj5u.com熱心網友回復:
結構是這樣的:<dependencies><dependency>...</dependency></dependencies><parent>....</parent>uj5u.com熱心網友回復:
因為你外面沒有匯入parentuj5u.com熱心網友回復:
????其實那是兩張圖,上傳的氣候沒注意,兩個顏色太像,像一張圖似的,
uj5u.com熱心網友回復:
<project>
<repositories>
<repository>
<!-- Maven 自帶的中央倉庫使用的Id為central 如果其他的倉庫宣告也是用該Id 就會覆寫中央倉庫的配置 -->
<id>nexus-aliyun</id>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</repository>
</repositories>
</project>
以前我遇到這種情況,從5樓就解決了,你這個沒解決,要不你就試試上面代碼加到專案的pom.xml里,現在我一般都加到專案的pom.xml里
uj5u.com熱心網友回復:
你的idea里配置的maven是idea自帶的吧,并不是你本地的配置了阿里鏡像的那個uj5u.com熱心網友回復:


大佬看下我新發的圖片,我嘗試過切換成E盤那個maven,但沒有用,而且我覺得,xml檔案不是settings里面指定的哪一個嗎?如果不是,那設定的還有什么意義?
uj5u.com熱心網友回復:
大佬們,我點擊maven的clean后有報錯列印,我看報錯應該是找不到aliyun里面的這個jar包啊?uj5u.com熱心網友回復:
[INFO] Scanning for projects...Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.2.5.RELEASE/spring-boot-starter-parent-2.2.5.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.example:miaoshaDemo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.5.RELEASE from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at no local POM @ line 5, column 10
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.example:miaoshaDemo:0.0.1-SNAPSHOT (F:\miaoshaDemo\miaoshaDemo\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.example:miaoshaDemo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.5.RELEASE from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at no local POM @ line 5, column 10 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Process finished with exit code 1
uj5u.com熱心網友回復:
為什么我感覺是setting檔案有問題uj5u.com熱心網友回復:
我怕是路徑名出現特殊字符的問題,所以在E盤中重新創建了一個xml組態檔,并且配置中阿里云的id換了一個跟別的組態檔不一樣的,圖中可以看到,組態檔應該就是讀到我新寫的這一個了。但還是無法下載
然后去新建的倉庫中查看,能看到一個lastupdate檔案。
uj5u.com熱心網友回復:
大佬,我補下組態檔截圖,一共只修改了這兩處,其余位置都是標簽
檔案的截圖這是洗掉了所有備注后的截圖
uj5u.com熱心網友回復:
16樓的圖有錯誤我重新發一下。我怕是路徑名出現特殊字符的問題,所以在E盤中重新創建了一個xml組態檔,并且配置中阿里云的id換了一個跟別的組態檔不一樣的,圖中可以看到,組態檔應該就是讀到我新寫的這一個了。但還是無法下載

然后去新建的倉庫中查看,能看到一個lastupdate檔案。
uj5u.com熱心網友回復:
Local Repository 配置的路徑 和 settings.xml 中的路徑不一致
會不會是這個原因呢?
uj5u.com熱心網友回復:
沒有相關依賴是不會自動下載的,需要在pom檔案中匯入你所需要的相關依賴uj5u.com熱心網友回復:
我理解的依賴不就是在pom檔案中添加dependency標簽嗎?我一開始發的圖不算依賴嗎?
uj5u.com熱心網友回復:
不會,選擇xml后,local repository自動填充
uj5u.com熱心網友回復:
pom.xml配置應該是有問題的吧parent是在dependencies外的,并且是在它的上面的配置
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/124635.html
標籤:Web 開發
