java maven 存储库 sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37710721/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
maven repository sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
提问by user1539343
I have the fragment of pom.xml which tries to resolve the fitbit dependency:
我有 pom.xml 的片段,它试图解决 fitbit 依赖项:
<repositories>
<repository>
<name>FitBit GitHub Repo</name>
<id>fitbit4j</id>
<url>https://nexus.vanntett.net/content/repositories/fitbit/</url>
</repository>
</repositories>
I am getting the below error:
我收到以下错误:
Failed to collect dependencies at com.fitbit:fitbit4j:jar:1.0.26: Failed to read artifact descriptor for com.fitbit:fitbit4j:jar:1.0.26: Could not transfer artifact com.fitbit:fitbit4j:pom:1.0.26 from/to fitbit4j (https://nexus.vanntett.net/content/repositories/fitbit/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
I used these parameters in eclipse: -Dmaven.wagon.http.ssl.insecure=true - Dmaven.wagon.http.ssl.allowall=true
我在 eclipse 中使用了这些参数: -Dmaven.wagon.http.ssl.insecure=true - Dmaven.wagon.http.ssl.allowall=true
which didn't work.
这没有用。
Please help.
请帮忙。
Thanks
谢谢
回答by positivecrux
you need to enter your certificate inside java cacert file,Please make sure you are selecting root ca certicate not the last one in hierarchy.
您需要在 java cacert 文件中输入您的证书,请确保您选择的是 root ca certicate 而不是层次结构中的最后一个。
Thislink demonstrate it the best.
这个链接是最好的证明。
Step 1 : Download certificate Step 2 : store inside cacert
第 1 步:下载证书第 2 步:存储在 cacert 中
That is it! your problem resolved.
这就对了!你的问题解决了。
回答by Cristian Meneses
回答by Bipin Kumar
Check that run keytool -import.. command from jre which exists uder jdk. like this.
检查是否从存在 uder jdk 的 jre 运行 keytool -import.. 命令。像这样。
1.Open cmd as admin...
1.以管理员身份打开cmd...
go to path: C:\Program Files\Java\jdk1.8.0_65\bin>
run bellow command.
keytool -import -noprompt -trustcacerts -alias certPen -file D:\certificates\ca-cert.pem -keystore "C:\Program Files\Java\jdk1.8.0_60\jre\lib\security\cacerts"
转到路径:C:\Program Files\Java\jdk1.8.0_65\bin>
运行下面的命令。
keytool -import -noprompt -trustcacerts -alias certPen -file D:\certificates\ca-cert.pem -keystore "C:\Program Files\Java\jdk1.8.0_60\jre\lib\security\cacerts"
and if u facing problem of file not found then set your all permission from Right click on cacerts → choose properties → select Securit tab → Allow all permissions to all the Group and user names.
如果您遇到找不到文件的问题,则从右键单击 cacerts → 选择属性 → 选择安全选项卡 → 允许所有组和用户名的所有权限设置您的所有权限。