在做spring boot项目的时候,我们经常会用到一个parent,pom配置文件如下
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
其实这个东西不是必须的,引用这个的作用仅仅是为了版本对其,所以即使你parent了他之后,如果要使用什么功能还是需要dependencies去引包。spring boot中除了boot本身的jar之外,还有很多spring的包版本,如果想要不引用parent,则可以引入以下
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.7.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
网友评论