使用公司代理在新的Spring Starter项目中使用不可解析的父POM

时间:2017-11-01 05:57:48

标签: spring-boot spring-tool-suite parent-pom

我刚刚开始使用STS,而我之前看过的答案对我的问题没有答案。

Project build error: Non-resolvable parent POM for learn.fullstack.ngspring:demo:0.0.1-SNAPSHOT: 
Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:1.5.8.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.8.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

1)我在Preferences - >下配置了代理设置。网络连接,允许我创建一个Spring Starter项目

2)我无法运行任何mvn命令

3)我使用自己的公司凭证创建了一个settings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
     <proxies>
       <proxy>
          <active>true</active>
          <protocol>http</protocol>
          <host>XXXXXX</host>
          <port>XX</port>
          <username>XXXXXXX</username>
          <password>XXXXXXX</password>
        </proxy>
      </proxies>
    </settings>

执行这两个步骤后无法工作。我的问题是:

1)我是否需要对pom.xml文件进行任何更改?

2)我在哪里可以找到当地的POM&#39;或指示STS指向本地POM?

3 个答案:

答案 0 :(得分:0)

您的协议正在为http设置代理,您还需要https代理,https://repo.maven.apache.org/maven2

答案 1 :(得分:0)

在Eclipse中选择窗口选项并转到首选项,然后转到Maven并更新.setting文件并更改代理用户名或密码。 然后转到Project,右键单击,然后选择Maven并更新Project

答案 2 :(得分:0)

尝试从位于C:\ Users \ username \ .m2的 .m2 文件夹中删除所有文件和目录(settings.xml,存储库等),然后使用mvn再​​次构建项目干净安装。