1

I have set all plugins to work with Maven But when I am trying to compile my Maven project

using following command

 mvn clean install -Dmaven.test.skip=true

I am getting following error in cmd

[ERROR] Error transferring file: 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 in fixing this issue.

Neha Shukla
  • 3,572
  • 5
  • 38
  • 69

3 Answers3

1

You will need to import HTTPS certificate of repository into java keystore or you can trust all certificates. Have a look at this How to tell Maven to disregard SSL errors (and trusting all certs)?

Community
  • 1
  • 1
Vinay Lodha
  • 2,185
  • 20
  • 29
0

I would suggest to add and specify java key store to get rid of these issues.

Full solution can be found here

simply download ssl certificate and use keytool to get jks file and specify that jks in MAVEN_OPTS environment variable.

But do not forget to put your jks file at project root i.e. just besides pom.xml

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

If you feel the source is secure and it's just something with your network, firewalls or antivirus and you can't solve it with nothing else:

You can ignore the SSL certificate error on Maven.

Just add -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true to your Maven Options

Guilherme Ferreira
  • 2,209
  • 21
  • 23