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
or in short: unable to find valid certification path to requested target maven, maven unable to find valid certification path to requested target
Maven is trying to connect to artifacts repository using https, but you don’t have valid ssl certificates.
To resolve this, you have a few options, but I will only show you how to make the 1. point
- Request that Maven accept the unsigned certificate anyhow.
- Make sure that the Java-based Maven trust store has the public certificate for the Nexus server.
- Have a root certificate authority like Verisign sign the certificate on Nexus.
Solution 1. Point
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
What Is Maven?
Maven, a Yiddish word meaning accumulator of knowledge, began as an attempt to simplify the build processes in the Jakarta Turbine project. There were several projects, each with their own Ant build files, that were all slightly different. JARs were checked into CVS. We wanted a standard way to build the projects, a clear definition of what the project consisted of, an easy way to publish project information, and a way to share JARs across several projects.
The result is a tool that can now be used for building and managing any Java-based project. We hope that we have created something that will make the day-to-day work of Java developers easier and generally help with the comprehension of any Java-based project.https://maven.apache.org/what-is-maven.html
What Is SSL?
A security mechanism for the Internet based on encryption is known as SSL, or Secure Sockets Layer. To provide privacy, authentication, and data integrity in Internet conversations, Netscape created it for the first time in 1995. The present TLS encryption now in use predates SSL.
The URL of a website that uses SSL/TLS begins with “HTTPS” rather than “HTTP.”
Could You Please Share This Post? I appreciate It And Thank YOU! :) Have A Nice Day!
YOU MIGHT ALSO LIKE
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?