How to
resolve the sun.security.validator.ValidatorException: PKIX path
building failed
When you first setup Maven in your office/home computer you
might come up with an exception as below when you try to run/build the Maven
project.
Could
not transfer artifact com.adobe.aem:aem-api:pom:6.0.0.1 from/to
adobe-public-releases (https://repo.adobe.com/nexus/content/groups/public):
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target -> [Help 1]
|
SOLUTION to sun.security.validator.ValidatorException: PKIX path building failed
So for the exception above we can see that the URL is
clearly mentioned in the exception report. In this case it is https://repo.adobe.com/nexus/content/groups/public
Resolution
Steps:
STEP 1: Navigate
to the URL in the exception report using a browser. In this case I am using
Google Chrome browser. See below snapshot.
STEP 2: Now press
F12 or right click on the page and click on “Inspect”. This will open the
developer tools.
STEP 3: Go to the
“Security” tab.
STEP 7: Now
search for “Manage Certificates”. Alternatively, you can open the “Internet
Options” in IE or similar browser and go to “Content” tab and click on “Certificates”
button.
STEP 10: Now run
the JAVA Keytool command to add this
certificate to your computer’s JDK keystore.
STEP 11: You
should run this command.
keytool
-import -alias ctsrootca3 -file
D:\certs\ctsrootca3.cer -keystore "C:\Program Files\Java\jdk1.8.0_152\jre\lib\security\cacerts"
|
Please make changes as below.
D:\certs\ctsrootca3.cer
- This should be the path to your
certificate file that you exported.
C:\Program
Files\Java\jdk1.8.0_152 – This should be path to your JDK folder.
If prompted for a password use : “changeit” (without the quotes,
this is the default password for cacerts file)
STEP 13: If you
have followed this steps correctly then now when you run Maven it should not
give any errors.












