💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 64.2 Gradle依赖管理 `spring-boot`插件自动应用[Dependency Management Plugin](https://github.com/spring-gradle-plugins/dependency-management-plugin/),并配置它导入`spring-boot-starter-parent` bom。这提供了跟Maven用户喜欢的相似依赖管理体验,例如,如果声明的依赖在bom中被管理的话,你就可以省略版本。为了充分使用该功能,只需要想通常那样声明依赖,但将版本号设置为空: ```text dependencies { compile("org.springframework.boot:spring-boot-starter-web") compile("org.thymeleaf:thymeleaf-spring4") compile("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect") } ``` **注** 你声明的`spring-boot` Gradle插件的版本决定了`spring-boot-starter-parent` bom导入的版本(确保可以重复构建)。你最好将`spring-boot` gradle插件版本跟Spring Boot版本保持一致,版本详细信息可以在[附录](https://github.com/cwiki-us-spring-guides/Spring-Boot-Reference-Guide/tree/0047aa8098a650dde0c93f4d2e91754c83468c4b/X.%20Appendices/E.%20Dependency%20versions.md)中查看。 `spring-boot`插件对于没有指定版本的依赖只会提供一个版本。如果不想使用插件提供的版本,你可以像平常那样在声明依赖的时候指定版本。例如: ```text dependencies { compile("org.thymeleaf:thymeleaf-spring4:2.1.1.RELEASE") } ```