前言
我们在新开始一个 SpringBoot 项目的时候,会默认继承 spring-boot-starter-parent ,像这样:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
这里继承了一些常用的依赖,但是如果我们需要继承自己的项目,应该怎么做?
添加配置
添加如下配置即可:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>