【问题标题】:Missing artifact org.springframework.boot:spring-boot-starter-parent:jar:1.3.2.RELEASE缺少工件 org.springframework.boot:spring-boot-starter-parent:jar:1.3.2.RELEASE
【发布时间】:2016-06-15 05:34:20
【问题描述】:

我在 POM.xml 中收到以下关于 Spring Boot 依赖的错误。

缺少工件 org.springframework.boot:spring-boot-starter-parent:jar:1.3.2.RELEASE

我尝试了以下链接中给出的所有解决方案,但没有解决我的问题:
Maven2: Missing artifact but jars are in place

【问题讨论】:

    标签: maven parent-pom


    【解决方案1】:

    您收到此错误是因为在 maven Central 中没有 spring-boot-starter-parent 的 jar 工件,因为 spring-boot-starter-parent 使用 pom 打包。这样做的原因是因为它打算用作父 pom:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.2.RELEASE</version>
    </parent>
    

    或者,如果您打算这样做,您可以只导入托管依赖项:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
                <version>1.3.2.RELEASE</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>   
        </dependencies>
    </dependencyManagement>
    

    您可以在Importing Dependencies section of the Introduction to the Dependency Mechanism 文章中阅读有关导入依赖项的更多信息。

    【讨论】:

    【解决方案2】:

    去掉spring boot starter父配置中的“-SNAPSHOT”如下图:

    当前:

    <parent>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-parent</artifactId>
       <version>{version}-SNAPSHOT</version>
    </parent>  
    

    例子:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.3-SNAPSHOT</version>
    </parent>
    

    删除版本后的样子:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>{version}</version>
    </parent>
    

    例子:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.3</version>
    </parent>
    

    【讨论】:

      猜你喜欢
      • 2018-05-19
      • 2016-05-24
      • 2020-08-15
      • 2021-02-26
      • 1970-01-01
      • 2016-06-03
      • 1970-01-01
      • 2021-03-29
      • 2022-07-30
      相关资源
      最近更新 更多