### 依賴管理
● 父項目做依賴管理
我們在pom.xml中添加了父項目`spring-boot-starter-parent`
```bash
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.4.RELEASE</version>
</parent>
```
`spring-boot-starter-parent`的父項目:
```
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.3.4.RELEASE</version>
</parent>
```
`spring-boot-dependencies`幾乎聲明了所有開發中常用的依賴的版本號,自動版本仲裁機制
```bash
<properties>
<activemq.version>5.16.6</activemq.version>
<antlr2.version>2.7.7</antlr2.version>
<appengine-sdk.version>1.9.98</appengine-sdk.version>
<artemis.version>2.19.1</artemis.version>
<aspectj.version>1.9.7</aspectj.version>
<assertj.version>3.22.0</assertj.version>
<atomikos.version>4.0.6</atomikos.version>
<awaitility.version>4.2.0</awaitility.version>
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
<byte-buddy.version>1.12.23</byte-buddy.version>
<cache2k.version>2.6.1.Final</cache2k.version>
<caffeine.version>2.9.3</caffeine.version>
<cassandra-driver.version>4.14.1</cassandra-driver.version>
<classmate.version>1.5.1</classmate.version>
<commons-codec.version>1.15</commons-codec.version>
<commons-dbcp2.version>2.9.0</commons-dbcp2.version>
...省略其余代碼
```
> 在我們項目開發中,父項目把我們開發中使用的常用jar包的依賴都管理起來,并且指定對應jar包的版本號,因此,我們在pom.xml中可以不用指定version(版本號)
**小結:**
無需關注版本號,自動版本仲裁
1、引入依賴如果在spring-boot-dependencies中定義了,可以不寫版本號
2、引入非版本仲裁的jar,要寫版本號
### 修改默認版本號
示例mysql-connector修改版本號:
1、查看`spring-boot-dependencies`里面規定當前依賴的版本 用的 key,如:
`<mysql.version>8.0.33</mysql.version>`
2、查找想要替換的版本:
mvn倉庫:
[https://mvnrepository.com/](https://mvnrepository.com/)
如,我們要替換的版本為6.0.5

3、在當前項目的pom.xml文件中可以重寫配置
```bash
<properties>
<mysql.version>6.0.5</mysql.version>
</properties>
```
### 場景啟動器(starter)
開發導入starter場景啟動器:
1、見到很多 spring-boot-starter-\* : \*表示某種場景,如web.
2、只要引入starter,這個場景的所有常規需要的依賴我們都自動引入
3、SpringBoot所有支持的場景
[https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-starter](https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-starter)
4、見到的 \*-spring-boot-starter: 第三方為我們提供的簡化開發的場景啟動器。
5、所有場景啟動器最底層的依賴`spring-boot-starter`
```bash
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.7.13</version>
</dependency>
```
### 圖形化展示依賴
可以通過idea提供的功能,在pom.xml文件中某個依賴右鍵,查看該starter的依賴圖形關系,如:spring-boot-starter-web

可以通過生成的依賴關系圖查看到spring-boot-starter-web所依賴的其它包。

- SpringBoot的生態
- 為什么使用SpringBoot ?
- SpringBoot所處的時代背景
- SpringBoot入門
- SpringBoot配置文件
- SpringBoot簡化部署-打jar包
- SpringBoot依賴管理
- SpringBoot自動配置
- SpringBoot容器功能
- SpringBoot應用應該如何編寫
- SpringBoot插件-Lombok
- SpringBoot-dev-tools
- SpringBoot-Spring Initializr
- SpringBoot配置文件-yml
- SpringMVC配置概覽
- SpringBoot靜態資源訪問
- SpringBoot歡迎頁與Favicon
- SpringBoot靜態資源配置原理
- SpringBoot請求參數處理
- SpringBoot普通參數與基本注解
- 模板引擎-Thymeleaf用法介紹
- SpringBoot使用Thymeleaf
- 后臺管理系統-登錄頁面整合
- 后臺登錄邏輯處理
- 抽取公共頁面-leftbar、header
- 公共頁面完善
- 動態表格遍歷
- 攔截器-登錄驗證
- 文件上傳功能
- 自定義錯誤處理
- 數據訪問-JDBC
- 使用Druid數據源
- 整合Mybatis
- 整合Mybatis-Plus
- 使用MybatisPlus完成CRUD功能
- 數據列表分頁功能
- 用戶刪除功能
- SpringBoot整合Redis
- Redis統計url訪問功能
- SpringBoot單元測試
- 單元測試-常用注解
- 單元測試-斷言
- SpringBoot指標監控
- 監控可視化整合
- SpringBoot-Profile功能
- SpringBoot原理解析
- 項目代碼倉庫地址