我们都知道创建Springboot项目可以继承Springboot父级工程,然后依次引入依赖
但是如果父级依赖被别的项目名占掉了要怎么办呢?
Springboot还有一种配置方式,可以不用继承Springboot父级工程,如下所示:
<parent>
<groupId>com.zhhe.springboot</groupId>
<artifactId>springboot-myparent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>springboot-three</artifactId>
<name>springboot-three</name>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>