Spring启动应用程序错误:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException

时间:2018-01-30 01:32:51

标签: spring maven

我使用Spring Boot创建了spring批处理应用程序。一旦我使用Eclipse打开它,我就会在pom.xml中收到以下错误。

Project build error: Non-resolvable parent POM for org.bcbsri.batch:DS-Script:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.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 and 'parent.relativePath' points at no local POM

我从https://repo.maven.apache.org/maven2下载了证书,并尝试导入新创建的jks文件。我不知道如何提供这个jks文件的路径。我没有管理员权限。因此,我无法在Java cacert中导入此证书。

1 个答案:

答案 0 :(得分:0)

我会说你的问题与Problems using Maven and SSL behind proxy

重复

您需要将maven证书导入到您正在使用的JDK。假设您将maven证书下载为C:\ mavenrepocert.cer并使用jdk1.8.0_151,您可以从命令行导入以下证书: keytool -import -file C:\mavenrepocert.cer -keystore "C:\Program Files\Java\jdk1.8.0_151\jre\lib\security\cacerts" -alias mavencert