3

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

user1539343
  • 1,569
  • 6
  • 28
  • 45

3 Answers3

6

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.

Community
  • 1
  • 1
positivecrux
  • 1,307
  • 2
  • 16
  • 35
2

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.

Cristian Meneses
  • 4,013
  • 17
  • 32
0

Check that run keytool -import.. command from jre which exists uder jdk. like this.

1.Open cmd as admin...

  1. go to path: C:\Program Files\Java\jdk1.8.0_65\bin>

  2. run bellow command.

    keytool -import -noprompt -trustcacerts -alias certPen -file D:\certificates\ca-cert.pem -keystore "C:\Program Files\Java\jdk1.8.0_60\jre\lib\security\cacerts"

and if u facing problem of file not found then set your all permission from Right click on cacerts → choose properties → select Securit tab → Allow all permissions to all the Group and user names.

artplastika
  • 1,972
  • 2
  • 19
  • 38