【问题标题】:Spring Boot 2.2.1 RELEASE build error-relative pathSpring Boot 2.2.1 RELEASE 构建错误相对路径
【发布时间】: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>

我将版本版本定义更改为&lt;properties&gt; 标记,如下所示

<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

我尝试了以下解决方案

  • &lt;relativePath/&gt; to &lt;relativePath&gt;/&lt;relativePath&gt;

  • &lt;relativePath/&gt; to &lt;relativePath&gt;../pom.xml/&lt;relativePath&gt;

  • Updated maven project

我也尝试了以下链接 stackoverflow

【问题讨论】:

    标签: spring maven spring-boot maven-3


    【解决方案1】:

    没有办法不从父 POM 继承属性。在父级中定义的属性在子级中可见。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-19
      • 2018-10-18
      相关资源
      最近更新 更多