1、父项目
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>1.5.8.RELEASE</version>
</parent>
点spring-boot-starter-parent进去,可以看到还有一个标签,是spring-boot-starter-parent的父项目,他是真正管理Springboot里面所有应用依赖的版本,也可以称为Springboot的版本仲裁中心(以后我们导入依赖默认是不需要写版本号的)
<!--spring-boot-starter-parent的父项目:-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.8.RELEASE</version>
<relativePath>../../spring-boot-dependencies</relativePath>
</parent>
2、导入依赖
<dependency>
<artifactId>spring-boot-starter-web</artifactId>
<groupId>org.springframework.boot</groupId>
</dependency>
spring-boot-starter-web:
spring-boot-starter这个是springboot的场景启动器,帮我们导入了web模块开发所需要的依赖,这些依赖的版本都受父项目的仲裁控制。springboot中还有类似很多的场景启动器:(下图来自官网)
要用什么功能就导入什么场景启动器,版本由仲裁控制,非常方便。