如何通过Spring Boot的Git仓库查询依赖版本及Starter所含依赖
通过Spring Boot Git仓库查询starter依赖及版本的方法
针对你项目里用的3.2.0-M1版本Spring Boot,按以下步骤在Git仓库里查找:
1. 查看starter包含的直接依赖
Spring Boot的所有官方starter都存放在仓库的spring-boot-project/spring-boot-starters目录下,每个starter对应独立的子文件夹:
- 查
spring-boot-starter-security:进入spring-boot-starters/spring-boot-starter-security目录,打开其中的pom.xml,<dependencies>区块里就是这个starter直接引入的所有依赖(比如spring-security-web、spring-security-config等)。 - 查
spring-boot-starter-web:同理进入spring-boot-starters/spring-boot-starter-web目录,打开pom.xml就能看到它包含的spring-web、spring-webmvc等直接依赖。
2. 查找依赖的具体版本
starter的pom里不会写依赖版本,所有版本都由Spring Boot的依赖管理BOM(spring-boot-dependencies)统一维护:
进入仓库的spring-boot-project/spring-boot-dependencies目录,打开对应3.2.0-M1版本的pom.xml,找到<dependencyManagement>区块,这里面列出了所有受Spring Boot管控的依赖及其对应的版本号,你要找的spring-security-core、spring-web的版本都能在这里查到。
注意:操作时要确保切换到Git仓库的3.2.0-M1标签或对应分支,才能看到匹配你项目版本的配置文件。
内容的提问来源于stack exchange,提问作者slarkwithskadi
相关产品推荐
相关产品推荐

