Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven repository sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:

Tags:

java

maven

I have the fragment of pom.xml which tries to resolve the fitbit dependency:

<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

which didn't work.

Please help.

Thanks

like image 572
user1539343 Avatar asked Jan 25 '26 09:01

user1539343


2 Answers

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.

This link demonstrate it the best.

Step 1 : Download certificate Step 2 : store inside cacert

That is it! your problem resolved.

like image 141
positivecrux Avatar answered Jan 26 '26 22:01

positivecrux


It seems like your JDK does not have the CA root for the SSL certificate from the repository.

You can find a nice article here about downloading those certificates and adding it to your Java JDK.

like image 23
Cristian Meneses Avatar answered Jan 26 '26 23:01

Cristian Meneses