【发布时间】:2020-03-22 14:29:30
【问题描述】:
在我的pom.xml 文件中添加 spring-boot 父级,如下所示
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1 RELEASE</version>
<relativePath/>
</parent>
我将版本版本定义更改为<properties> 标记,如下所示
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>2.2.1.RELEASE</spring-boot.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring-boot.version}</version>
<relativePath/>
</parent>
在此更改后出现构建错误
Project build error: Non-resolvable parent POM for abc:abc:7.0.0.0: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:${spring-boot.version} in 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 and 'parent.relativePath' points at no local POM
我尝试了以下解决方案
<relativePath/> to <relativePath>/<relativePath><relativePath/> to <relativePath>../pom.xml/<relativePath>Updated maven project
我也尝试了以下链接 stackoverflow
【问题讨论】:
标签: spring maven spring-boot maven-3