缺失的构件:org.springframework.boot:spring-boot-starter-parent:jar:1.3.2.RELEASE

35
我在POM.xml中使用Spring Boot依赖时,出现以下错误:

Missing artifact org.springframework.boot:spring-boot-starter-parent:jar:1.3.2.RELEASE

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

51

您之所以会遇到此错误,是因为Maven中央仓库中没有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>

您可以在依赖机制介绍文章的“导入依赖”部分阅读更多有关导入依赖的内容。


目前,您应该使用spring-boot-dependencies:https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-build-systems.html#using-boot-maven-without-a-parent - wcislo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接