問題:
當在pom中隨便添加某依賴,比如:
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.0.4</version>
</dependency>
會拉取失敗,并給出下載的地址。點擊下載的地址會跳轉到瀏覽器,自動下載該jar包。這是什么原因?(Windows10環境下)
報錯資訊如下:
Could not transfer artifact org.mongodb:mongo-java-driver:pom:3.0.4 from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): Transfer failed for http://maven.aliyun.com/nexus/content/repositories/central/org/mongodb/mongo-java-driver/3.0.4/mongo-java-driver-3.0.4.pom
紅色的就是給出的下載鏈接
settings.xml已經是阿里的,如下:
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
哪位大神知道啥原因嗎?
uj5u.com熱心網友回復:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
uj5u.com熱心網友回復:
試了你這個,不起作用。在IDEA中的錯誤報錯還是和之前的一樣,在eclipse里的是Project build error: Non-resolvable parent POM for knowledgeGraph:knowledgeGraph:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.1.12.RELEASE from
http://maven.aliyun.com/nexus/content/repositories/central/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced.
Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.12.RELEASE from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/):
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 wrong local POM
我之前查了下覺得是證書的問題,去阿里倉庫下載了證書匯入到jrd的keytool中去了,但還是不起作用。現在只能通過他下載失敗給的連接,然后手動下載jar移到本地倉庫檔案夾里
uj5u.com熱心網友回復:
本地倉庫中的lastU那檔案我也每次都去清了,但還是不行uj5u.com熱心網友回復:
不如試試我這個<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/27814.html
標籤:Web 開發
下一篇:vs code編譯是Java亂碼
