简体   繁体   中英

How to get spring-boot dependency version in gradle?

I have a standard spring-boot project with org.springframework.boot:spring-boot-gradle-plugin . i know i can override dependency version with eg

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

but how can i get the version currently imported by spring-boot plugin so i can use it later in the script? for example:

currentSlf4jVersion = xxx('slf4j.version')

The dependency management plugin that Spring Boot's plugin applies for you provides programmatic access to the properties in imported boms .

You can get the value of the slf4j.version property like this:

dependencyManagement.importedProperties['slf4j.version']

You can find your gradle project dependencies using command

gradle dependencies

For All:

gradle listAllDependencies

For sub-project:

gradle :<subproject>:dependencies

This will output dependencies

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM