在使用Spring Boot时,通常,首先需要继承spring-boot-starter-parent 这个parent
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
但是,在某些情况下,该Spring Boot App作为一个module存在于某个项目中时,已经存在存在了一个parent,这种情况下,无法再引入上述parent。针对这种情况,需要在parent中添加以下内容。
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>latest</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
网友评论