Maven和Spring Boot-无法解析的父pom-repo.spring.io(未知主机) [英] Maven and Spring Boot - non resolvable parent pom - repo.spring.io (Unknown host)
问题描述
我正在尝试构建我的项目,但是我得到了:
I am trying to build my project but I get this:
不可解析的父POM:无法从/到spring-snapshots传输工件org.springframework.boot:spring-boot-starter-parent:pom:1.3.0.M3(
Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.3.0.M3 from/to spring-snapshots (http://repo.spring.io/snapshot): repo.spring.io and 'parent.relativePath' points at no local POM @ line 16, column 10: Unknown host repo.spring.io -> [Help 2]
这是我指定pom.xml的父级的方法:
Here is how I specify the parent of my pom.xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.M3</version>
<relativePath></relativePath>
</parent>
为空,因此它迫使Maven在远程存储库中寻找父级.但是,它说 repo.spring.io是未知主机.
The is empty so that it forces maven to look for the parent in the remote repository. However, it says that repo.spring.io is an unknown host.
这是我在pom.xml中定义存储库的方式:
Here is how I define the repositories in my pom.xml:
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
有什么想法吗?
推荐答案
很明显,这是您的互联网连接出现问题.检查是否可以通过浏览器访问 http://repo.spring.io .如果是,请检查是否需要配置代理服务器.如果否,则应与您的互联网提供商联系.
Obviously it's a problem with your internet connection. Check, if you can reach http://repo.spring.io with your browser. If yes, check if you need to configure a proxy server. If no, you should contact your internet provider.
以下是文档,介绍如何为Maven配置代理服务器: https: //maven.apache.org/guides/mini/guide-proxies.html
Here is the documentation, how you configure a proxy server for Maven: https://maven.apache.org/guides/mini/guide-proxies.html
这篇关于Maven和Spring Boot-无法解析的父pom-repo.spring.io(未知主机)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!