Spring Boot 2.2.1 RELEASE 构建错误相对路径
Spring Boot 2.2.1 RELEASE build error-relative path
正在我的 pom.xml
文件中添加 spring-boot parent,如下所示
<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
我也尝试关注 link
Whosebug
没有办法不从父 POM 继承属性。在父项中定义的属性在子项中可见。
正在我的 pom.xml
文件中添加 spring-boot parent,如下所示
<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
我也尝试关注 link Whosebug
没有办法不从父 POM 继承属性。在父项中定义的属性在子项中可见。