SpringBoot入門案例解析值starter

2022-10-10 21:27:16 字數 856 閱讀 6264

上一節我們講到你的pom.xml中不寫版本號是怎麼跑起來的呢,是通過parent獲取的版本號。

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-test

test

下面看一下spring-boot-starter-web這裡面有什麼東西

可以看到spring-boot-starter-web裡面又包含了一堆starter。

可以看到spring-boot-starter-web裡面有一堆的依賴配置,也就是spring-boot-starter-web依賴於這裡面的依賴配置,而pom.xml有依賴於spring-boot-starter-web,所以這就是傳遞依賴。

springboot之所以這麼好用就是因為這個一堆的starter。

假如我想要a技術的starter直接引用a技術的starter即可,是很方便的,因為乙個starter加入進來後,它裡面還有很多的東西,其他是不用管的。

Spring Boot入門案例修改預設配置 二

spring boot官方聲稱搭建web應用開箱即用,其根本原因就是底層封裝好大部分的約束和配置,而作為合格的開發者,肯定要對這些配置有點好奇心,修改定製成自己的web應用才能用得舒服。最近在學習springboot時搜尋網上的一些教程看到修改banner的教程,也嘗試了一把,記錄這個好玩的東西。首...

Hibernate入門 入門案例

4.1 資料庫建立表 create table cst customer cust id bigint 32 not null auto increment comment 客戶編號 主鍵 cust name varchar 32 not null comment 客戶名稱 公司名稱 cust so...

SpringBoot使用jasypt加解密密碼

在我們的服務中不可避免的需要使用到一些秘鑰 資料庫 redis等 開發和測試環境還好,但生產如果採用明文配置講會有安全問題,jasypt是乙個通用的加解密庫,我們可以使用它。dependency groupid com.github.ulisesbocchio groupid artifactid ...