gpt4 book ai didi

java - 如何在 gradle 中获取 spring-boot 依赖版本?

转载 作者:行者123 更新时间:2023-12-04 18:59:09 24 4
gpt4 key购买 nike

我有一个标准的 spring-boot 项目 org.springframework.boot:spring-boot-gradle-plugin .我知道我可以用例如覆盖依赖版本

ext['slf4j.version'] = '1.7.5'

但是如何获取当前由 spring-boot 插件导入的版本,以便稍后在脚本中使用它?例如:
currentSlf4jVersion = xxx('slf4j.version')

最佳答案

dependency management plugin为您提供的 Spring Boot 插件提供 programmatic access to the properties in imported boms .

您可以获取 slf4j.version 的值像这样的属性:

dependencyManagement.importedProperties['slf4j.version']

关于java - 如何在 gradle 中获取 spring-boot 依赖版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42280118/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com