在没有父POM的情况下使用Spring Boot

时间:2017-03-26 04:43:52

标签: maven spring-boot

我正在尝试将两个Maven项目合并为一个,而它们都有<parent>部分。由于其中一个是Spring-Boot项目,根据this documentation,我应该能够通过导入将Spring-Boot所需的依赖项包含到我的项目中:

<dependencyManagement>
     <dependencies>
        <dependency>
            <!-- Import dependency management from Spring Boot -->
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>2.0.0.BUILD-SNAPSHOT</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

但是当我删除Maven项目的父节并将上面的标记添加到我的<dependencyManagement>时,代码不再编译,并显示以下错误消息:

Error:(5, 45) java: package org.springframework.boot.test.context does not exist

有人可以告诉我如何从<parent>切换到<dependencyManagement>吗?

0 个答案:

没有答案