6
votes

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

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')
2

2 Answers

6
votes

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']
0
votes

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