SpringBoot
约 330 字大约 1 分钟
SpringBoot
1 起步依赖

在SpringBoot项目中,起步依赖有一个共同的特征:都是以spring-boot-starter-
作为开头
起步依赖特殊之处
spring-boot-starter-web:包含了web应用开发所需要的常见依赖
spring-boot-starter-test:包含了单元测试所需要的常见依赖
spring-boot-starter-web
内部把关于Web开发所有的依赖都已经导入并且指定了版本,只需引入 spring-boot-starter-web
依赖就可以实现Web开发的需要的功能

Spring官方提供了很多现成的starter(起步依赖),开发相关应用时,只需要引入对应的starter即可。

每一个起步依赖,都用于开发一个特定的功能。
举例:
开发中需要使用redis数据库时,只需要在SpringBoot项目中,引入:spring-boot-starter-redis ,即可导入redis开发所需要的依赖
2 SpringBoot父工程
SpringBoot通过maven引入的依赖,是没有指定具体的依赖版本号的。

为什么没有指定<version>版本号,可以正常使用呢?
- 因为每一个SpringBoot工程,都有一个父工程。依赖的版本号在父工程中统一管理。
