问题描述:
idea无法下载远程仓库jar包,最奇怪的是idea有多个项目,有些项目可以下载,有些项目不行。报错如下:
一开始:
unable to find valid certification path to requested target
Try run Maven import with -U flag (force update snapshots)
重新reload mave项目后:
org.json:json:pom:20160810 failed to transfer from https://********/maven-release/ during a previous attempt.
This failure was cached in the local repository and resolution is not reattempted until the update interval of artifactory-repo has elapsed or updates are forced.
Original error: Could not transfer artifact org.json:json:pom:20160810 from/to artifactory-repo (https://****************/maven-release/):
transfer failed for https://**********************/maven-release/org/json/json/20160810/json-20160810.pom
Try run Maven import with -U flag (force update snapshots)
删掉本次下载的错误文件后又变成:
unable to find valid certification path to requested target
Try run Maven import with -U flag (force update snapshots)
通过上面可以知道第二个报错的原因是因为本地已经存在.lastupdate文件引起的。因为删除以后就不报那个错了。
所以可以大概猜出报错原因是因为证书问题。从报错unable to find valid certification path to requested target可以看出来。
于是开始处理证书问题:
在file->settings->Maven->Importing下的VM加上以下代码(下载jar包忽略证书)
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
于是乎问题得到解决。
参考文章:
Maven依赖下载报错 unable to find valid certification path to requested target_maven unable to find valid certification path to r-CSDN博客
idea maven unable to find valid certification path to requested target..._idea unable to find valid certification path to re-CSDN博客