Maven error stating that PKIX path building failed: unable to find the valid certificate

632 Views Asked by At

While i am building the code in my local, I am getting this error.

I have tried downloading the certificate from https://repo.maven.apache.org/maven2, and through cmd , i have given the command to trust the certificate but this has not solved the problem.

Non-resolvable import POM: Could not transfer artifact org.junit:junit-bom:pom:5.6.2 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Please help me how I can fix this issue

I have tried downloading the certificate from https://repo.maven.apache.org/maven2, and through cmd , i have given the command to trust the certificate but this has not solved the problem.

1

There are 1 best solutions below

0
On

Starting with Maven 3.9 they changed the default Transport implementation to native.

Try with this option to disable SSL verifications:

mvn compile -Daether.connector.https.securityMode=insecure

Background: https://maven.apache.org/guides/mini/guide-resolver-transport.html