初识Spring Boot(一)
2018-04-07 18:31
246 查看
01.依赖管理
表面是spring-boot-starter-parent管理依赖
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
他的父项目是
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath>../../spring-boot-dependencies</relativePath>
</parent>
spring-boot-dependencies来真正管理Spring Boot应用里面的所有依赖版本;
他是Spring Boot的版本仲裁中心;
以后我们导入依赖默认是不需要写版本;(没有在dependencies里面管理的依赖自然需要声明版本号)。
02.启动器
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
spring-boot-starter:spring-boot场景启动器;帮我们导入了web模块正常运行所依赖的组件;
Spring Boot将所有的功能场景都抽取出来,做成一个个的starters(启动器),只需要在项目里面引入这些starter相关场景的所有依赖都会导入进来。要用什么功能就导入什么场景的启动器
表面是spring-boot-starter-parent管理依赖
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
他的父项目是
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath>../../spring-boot-dependencies</relativePath>
</parent>
spring-boot-dependencies来真正管理Spring Boot应用里面的所有依赖版本;
他是Spring Boot的版本仲裁中心;
以后我们导入依赖默认是不需要写版本;(没有在dependencies里面管理的依赖自然需要声明版本号)。
02.启动器
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
spring-boot-starter:spring-boot场景启动器;帮我们导入了web模块正常运行所依赖的组件;
Spring Boot将所有的功能场景都抽取出来,做成一个个的starters(启动器),只需要在项目里面引入这些starter相关场景的所有依赖都会导入进来。要用什么功能就导入什么场景的启动器
相关文章推荐
- 初识elasticsearch_2(查询和整合springboot)
- Spring boot返回静态页面初识
- [Spring Boot]1.初识Spring Boot
- 初识Spring Boot(四)
- springboot学习: 初识Spring Boot框架,搭建第一个项目!
- 初识Spring Boot框架(二)之DIY一个Spring Boot的自动配置
- 初识SpringBoot @Autowired注入失败
- 初识spring-boot
- 初识Spring Boot框架
- 初识Spring Boot框架 (一)
- SpringBoot(二):初识SpringBoot HelloWorld
- 初识Spring Boot框架
- 1.SpringBoot系列-初识SpringBoot
- 初识Spring Boot框架
- 初识Spring Boot框架(二)之DIY一个Spring Boot的自动配置
- (二)初识springboot之使用fastjson解析数据(解决乱码及简单配置)
- 初识Spring Boot框架
- 初识Spring Boot框架
- 初识Spring Boot框架
- 初识Spring-boot