Eclipse中不可解析的父POM

时间:2018-10-31 08:10:44

标签: eclipse maven spring-boot proxy http-proxy

我已将maven项目导入到Eclipse版本:2018-09(4.9.0),但在pom文件中出现此错误。我在另一台计算机上已经有相同的项目,并且工作正常。该项目是springBoot 2.0.6.RELEASE

Project build error: Non-resolvable parent POM for es.teatreDeGuerrila:teatreDeGuerrilaCloudApp:1.0.0-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.0.6.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.0.6.RELEASE from/to central (https://repo.maven.apache.org/maven2): connect timed out and 
 'parent.relativePath' points at no local POM

我在类中有很多编译错误,例如

The import org.springframework cannot be resolved

从命令行使用mvn install -Dmaven.test.skip=true,一切正常。

并且我已经在Eclipse中作为Manual进行了代理,其设置与文件../maven/conf/settings.xml

中的设置相同
<proxy>
      <id>httpproxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.teatre.guerrila.int</host>
      <port>8080</port>
      <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
    </proxy>
     <proxy>
      <id>httpsproxy</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>proxy.teatre.guerrila.int</host>
      <port>8443</port>
      <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
    </proxy>
  </proxies>

Eclipse settings

1 个答案:

答案 0 :(得分:1)

似乎您使用的是外部Maven,而不是嵌入式Maven。 请检查

1)在eclispe->首选项-> Maven->安装中,您已经检查了外部maven

2)在eclispe->首选项-> Maven->用户设置中,指向您提到的设置文件