I am creating a simple spring boot project using intellij ideas's built in spring initializer feature. below are the steps that i am performing.
Now on clicking after finish button IDE open's the project, and on bottom i see resolving dependency for a very short period (after clicking the maven tool window there are no dependencies which i selected earlier)
I tried to resolved the dependency using command mvn:install but get's an error
"Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.6.RELEASE from/to central ( https://repo.maven.apache.org/maven2 ): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
I tried maven command clean install using cmd from my project directory and got the same error mentioned above in the question. The issue has no relation to IntelliJ IDEA. JVM used to run Maven seems to miss the certificates needed to access the repository.
So below are the steps i followed and it fixed this issue for me.
Get the certificate from https://repo.maven.apache.org/maven2/ .
(to get the certificate follow steps) -
On certificate window click details tab then click copy to file button then next button.
accept the default file format and save it to locally on your system.
Now here is the command to install certificate. In command prompt, go to directory C:\Program Files\Java\jdk1.8.0_144\jre\lib\security and do the following.
keytool -import -file C:\maven.cer -keystore cacerts -alias mavencert
Note : run cmd as an administrator.
Please use the following steps to resolve the dependency issue in Intellij IDE:
IntelliJ -> Maven -> Toggle Offline mode option
Deleting .idea
folder, .m2
folder and invalidating cache won't worked for but toggling offline mode done the job.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.