Maven: Could not resolve dependencies for project… Could not transfer artifact… sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertP athBuilderException: unable to find valid certification path to requested target -> [Help 1]

Maven is trying to connect to artifact repository using https, but you don’t have valid ssl certificates.

Solution

Let’s use maven option like below to allow maven use insecure connection. Additionally I added -U option to enforce downloading of artifacts. The example use compile goal but of course you can use another variation like install, package, deploy and etc.

mvn clean compile -U -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true 

If you enjoyed this post please add the comment below or share this post on your Facebook, Twitter, LinkedIn or another social media webpage.
Thanks in advanced!

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments