我有org.springframework.boot:spring-boot-gradle-plugin
的标准spring-boot项目。我知道我可以用例如覆盖依赖版本
ext['slf4j.version'] = '1.7.5'
但是如何才能获得spring-boot插件当前导入的版本,以便稍后在脚本中使用它?例如:
currentSlf4jVersion = xxx('slf4j.version')
答案 0 :(得分:4)
Spring Boot的插件适用于你的dependency management plugin提供了programmatic access to the properties in imported boms。
您可以像这样获取slf4j.version
属性的值:
dependencyManagement.importedProperties['slf4j.version']
答案 1 :(得分:0)
您可以使用命令
找到您的gradle项目依赖项gradle dependencies
全民:
gradle listAllDependencies
对于子项目:
gradle :<subproject>:dependencies
这将输出依赖项