首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在错误的本地POM中找到指向请求目标和“parent.relativePath”点的有效证书路径

无法在错误的本地POM中找到指向请求目标和“parent.relativePath”点的有效证书路径
EN

Stack Overflow用户
提问于 2020-01-05 09:22:10
回答 1查看 11.1K关注 0票数 2

我正试图使用maven Spring库并遵循教程,为java (eclipse)中的微服务构建一个概念的证明。

下面是我的POM文件,它显示了一个我无法解决的错误:

代码语言:javascript
复制
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.tutorials</groupId>
  <artifactId>HelloWorld</artifactId>
  <version>0.0.1-SNAPSHOT</version>


<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.0.RELEASE</version>
</parent>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

</project>

在标记<parent>上,我有以下错误:

代码语言:javascript
复制
Project build error: Non-resolvable parent POM for com.tutorials:HelloWorld:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:
 1.2.0.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.2.0.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 wrong local POM

我怎样才能解决这个问题?谢谢。

编辑:在User/.m2目录中创建了一个settings.xml文件以克服代理问题,如下所示:

代码语言:javascript
复制
<settings>
  <proxies>
   <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.example.com</host>
      <port>8080</port>
      <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
    </proxy>
  </proxies>
</settings>

现在,错误如下:

代码语言:javascript
复制
Project build error: Non-resolvable parent POM for com.tutorials:HelloWorld:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:
 2.2.2.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:2.2.2.RELEASE from/to central (https://
 repo.maven.apache.org/maven2): proxy.example.com and 'parent.relativePath' points at wrong local POM
EN

回答 1

Stack Overflow用户

发布于 2022-09-17 08:43:59

问题是证书没有安装在您的java安全性中。正如您前面提到的,您可以访问https://repo.maven.apache.org/maven2/,如果您使用的是chrome,则需要从站点信息导出证书。

之后,您需要在Keystore中安装证书,如果是

java 8:jdk->jre->lib->

java 11 :jdk->lib->

命令安装证书:

keytool -import -noprompt -trustcacerts -alias -file -keystore -storepass

这个问题早在两年前就有人提出了,但希望有人能从中得到帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59598487

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档