新手裝好maven之后,第一個maven項目創建完成,構建報錯如下:
Could not transfer artifact
org.springframework.boot:spring-boot-starter-parent:pom:2.3.4.RELEASE
from/to nexus-aliyun
(http://maven.aliyun.com/nexus/content/groups/public): E:\Program
Files\apache-maven-3.6.3\repository\org\springframework\boot\spring-boot-starter-parent\2.3.4.RELEASE\spring-boot-starter-parent-2.3.4.RELEASE.pom.part.lock
(系統找不到指定的路徑。)
該如何解決?
網上的方法匯總:
1.首先保證你的setting沒問題。
檢查settsings.xml文件里面庫的路徑和上述Local respository一致。
2.maven鏡像資源可以設置為:
<mirrors>
<!-- 阿里雲倉庫 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- junit鏡像地址 -->
<mirror>
<id>junit</id>
<name>junit Address/</name>
<url>http://jcenter.bintray.com/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://central.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
3. 解決證書問題
向File - settings中的maven - importing中添加這句
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
到這里基本就ok了如果還不行,再向File - settings中的maven - Runner中添加這句話:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -DarchetypeCatalog=internal
如果以上的問題都弄了還有問題,那么很有可能就是User用戶對你創建的Maven的倉庫的文件夾的訪問權限不夠,添加寫入權限。