Maven 和 Spring Boot - 不可解析的父 pom - repo.spring.io(未知主机) [英] Maven and Spring Boot - non resolvable parent pom - repo.spring.io (Unknown host)

查看:57
本文介绍了Maven 和 Spring Boot - 不可解析的父 pom - repo.spring.io(未知主机)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建我的项目,但我明白了:

I am trying to build my project but I get this:

不可解析的父 POM:无法将工件 org.springframework.boot:spring-boot-starter-parent:pom:1.3.0.M3 from/to spring-snapshots (http://repo.spring.io/snapshot):repo.spring.io 和 'parent.relativePath' 指向没有本地 POM @ line 16,第 10 列:未知主机 repo.spring.io ->[帮助2]

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>

有什么想法吗?

推荐答案

很明显,这是您的 Internet 连接问题.检查是否可以使用浏览器访问 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆