不可解析的父POM

时间:2018-10-24 13:56:10

标签: java spring maven

我遇到以下错误:

The project com.TestOne:test:0.0.1-SNAPSHOT (C:\Users\KroemerT\eclipse- 
workspace\KeydoxWeb\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.TestOne:test:0.0.1-SNAPSHOT: 
Could not transfer artifact org.springframework.boot:spring-boot-starter- 
parent:pom:2.0.6.RELEASE from/to spring-snapshot 
(http://repo.spring.io/snapshot): connect timed out and 
'parent.relativePath' points at no local POM @ line 14, column 13 -> [Help 
2]

我犯了一个明显的错误,并删除了.m2中的存储库,现在出现了以上错误。有什么办法可以解决这个问题?

我的POM是:

<?xml version="1.0" encoding="UTF-8"?>
<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.TestOne</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>test-services</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.6.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>


<repositories>
    <!-- ... possibly other repository elements ... -->
    <repository>
        <id>spring-snapshot</id>
        <name>Spring Snapshot Repository</name>
        <url>http://repo.spring.io/snapshot</url>
    </repository>
</repositories>


<dependencies>
....

2 个答案:

答案 0 :(得分:1)

http://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-parent/中没有版本1.4.4.RELEASE

我会从Maven Central那里获取org.springframework.boot:spring-boot-starter-parent:2.0.6.RELEASE,在该网站上搜索Maven Central的最新版本是一般性建议,因为教程往往会随着时间的推移而过时。

答案 1 :(得分:1)

好的,我解决了我的问题:

我创建了settings.xml并设置了一些代理配置。在日食方面也是如此。