PKIX error in eclipse maven
When encountering a PKIX error during maven update or build in eclipse, this could be due to security/certificate restrictions on your machine from downloading dependencies from a given remote repository.
1. check if JAVA_TOOLS_OPTIONS (or some other similar variable) is set in Windows environment variables and check if -Djavax.net.ssl.trustStore is set there.
- if present, check if this variable points to a file other than “C:\Program Files\Java\jrexxx\lib\security\cacerts”. If it does refer to a custom file, it may be using a restricted list of maven repositories and does not include what you need. In this case, you may force eclipse to not refer to this truststore and use the default truststore in the jdk or jre installation folder instead by adding these in the eclipse.ini found in the eclipse installation folder:
-Djavax.net.ssl.trustStore=C:\Program Files\Java\jrexxx\lib\security\cacerts
-Djava.net.ssl.trustStorePassword=changeit
Save the file (I suggest to create a backup of the original first), and restart eclipse for the changes to take effect.
2. another option is to add the required certificate to the target truststore.
in admin console in \jre\lib\security\ folder, run:
keytool -import -alias nwcrt -file newcert.cer -keystore cacerts -storepass changeit
Refer here for steps: https://stackoverflow.com/questions/4325263/how-to-import-a-cer-certificate-into-a-java-keystore