Build.gradle get dependency version

I’m using spring-boot with gradle and when I write some dependency like this:
I know that I may not specify version here, because it will be substituted from a parent project.
But sometimes I want to get version of this dependency. How can I get it? I want to write something like that:

print …hibernate.version… or ${hibernate.version} or something like this.

Help me please! :disappointed: