简体   繁体   中英

“PKIX path building failed” after importing certificate to java keystore

This is a test project that I am working on. I have imported existing maven projects and am just trying to run a "clean package" maven build. I followed this article and imported the certificate as suggested. But I am still getting the same error when I am trying to build the project:

Failed to execute goal on project xyz-automation-test: Could not resolve dependencies for project com.abc.xyz:xyz-automation-test:pom:LOCALBUILD: Failed to collect dependencies at com.abc.xyz:xyz-automation-framework:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for com.abc.xyz:xyz-automation-framework:jar:1.0-SNAPSHOT: Could not transfer artifact com.abc.xyz:xyz-automation-framework:pom:1.0-SNAPSHOT from/to test-automation-mvn (https://artifactory.corp.abc.com/artifactory/test-automation-mvn): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]

Can't understand what is the problem here?

Ultimately found the answer, though a silly one though. My eclipse was using the JRE rather than JDK, and all the security changes that I did was on the JDK. Of course it could not get the certificate, since it was sitting on the JRE. Changed Eclipse to use JDK and it is working fine now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM