<parent>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/>
</parent>
<dependencyManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<parent>:和Java继承一样,只能单继承,具有局限性
<dependencyManagement >:和Java组合一样,推荐使用
相同点:都能实现jar的版本管理
不同点:parent能让子工程继承自己的dependency,而dependencyManagement不行
网友评论