Intellij Maven Repository self signed certificate, ssl error
Asked Answered
B

2

19

In intellij (15.0.4) under settings->Maven->Repositories I get an error when clicking update on the companies repositories.

org.apache.maven.wagon.TransferFailedException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I can understand, since it is a self-signed untrusted certificate, however, I have added this certificate to settings->Tools->Server Certificates->Accepted Certificates.

I also added to settings->Maven->Runner->VM Options -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.insecure=true

I still get this problem.

Greatful for a solution.

Benison answered 8/6, 2016 at 9:14 Comment(1)
Adding the two VM Options to Maven Runner solved it for me (thanks for this!). No need to add the certificate to Server Certificates. IntelliJ IDEA ULTIMATE 2016.3.4Up
S
41

Update both Maven Importer and Runner in settings to allow all.

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
Runner

enter image description here

Importer

enter image description here

Samiel answered 29/11, 2018 at 6:33 Comment(3)
it solved my problem too, earlier i was just updating this in maven > importing. Putting the vm option command in Runner too did the trick.Inset
I get "Failed to read artifact descriptor for xxx:jar:0.1.0" after I entered these in VM Options for imported. This helped #35106167Firman
Great, Thanks for the answer. It saves my day.Finnie
G
0

In my case the settings mentioned above did not work. I put the both in the Runner and Importing sections:

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

The solution was to use DNS name instead of IP address in repositories.repository.url of the pom file

Not working:

<repositories>
    <repository>
        <id>ci-my-nexus</id>
        <name>My Nexus</name>
        <url>https://172.31.34.45/repository/my-maven/</url>
    </repository>
</repositories>

Working (mind the url part):

<repositories>
    <repository>
        <id>ci-my-nexus</id>
        <name>My Nexus</name>
        <url>https://artifacts.mycompany.com/repository/my-maven/</url>
    </repository>
</repositories>
Galliot answered 5/9, 2023 at 8:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.