8
votes

For example, how do I find out the version of Hibernate that the Spring Boot spring-boot-starter-data-jpa starter dependency is bringing into my project?

5

5 Answers

9
votes

The list of dependencies is available in the Appendix F. of the documentation and in the pom.xml of the spring-boot-dependencies artifact, which you should be able to find on your classpath.

You can also go the public repository of Spring Boot and see the pom.xml for every released version in a separate branch.

7
votes

When using maven, use the below command to print dependency tree

mvn dependency:tree

http://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html

When using gradle:

gradlew dependencies

dependencies - Displays all dependencies declared in root project 'my-project'.

dependencyInsight - Displays the insight into a specific dependency in root project 'my-project'.

Also, an IDE shows this information in some window. For example, IntelliJ shows all project dependencies in the project window under 'External Libraries' and in the maven window.

2
votes

To supplement Yuva's answer, if you are looking for hibernate's version, you may run

gradle dependencyInsight --dependency hibernate --configuration compile

or if your project is structured as a multi-project, under project root run

gradle submodule:dependencyInsight --dependency hibernate --configuration compile

The command gives result for what depends on hibernate in this project whereas gradle dependencies gives result for what dependencies this project have

0
votes

can also be found here:

https://docs.spring.io/spring-boot/docs/<version>/reference/htmlsingle/#appendix-dependency-versions

where version is spring-boot-starter-parent version. e.g.

https://docs.spring.io/spring-boot/docs/1.5.17.RELEASE/reference/htmlsingle/#appendix-dependency-versions
0
votes

we can get the version of Spring & SpringBoot from respective class SpringBootVersion & SpringVersion SpringBootVersion.getVersion() SpringVersion.getVersion()