2

So... here is the scenario.

Let's say I am trying to add library A to build.gradle file.

And I want to know if version of library A is managed by plugin io.spring.dependency-management.

How can I achieve that?

I am not giving specific library because the answer for specific library is not what I am looking for

thank you in advance!

my source code

Joo Hyuk Kim
  • 68
  • 1
  • 5
  • Does this answer your question? [What is the Gradle artifact dependency graph command?](https://stackoverflow.com/questions/12288133/what-is-the-gradle-artifact-dependency-graph-command) – pirho Dec 11 '21 at 15:07
  • sadly no. I need to know if version of a library is managed by "io.spring.dependency-management" – Joo Hyuk Kim Dec 12 '21 at 09:14
  • The dependency management plugin doesn't manage dependencies. It adds some features to gradle which are akin to maven. If you now import a bom etc. that is what is managing the dependencies. In your case that would be Spring Boot which manages versions of some supported libraries. To figure out, what is managed, if it gives an error it isn't. – M. Deinum Dec 13 '21 at 07:41
  • @M.Denium thanks for your reply. So I was again searching based on your answer. Do you think this [documentation of gradle](https://docs.gradle.org/current/userguide/platforms.html#:~:text=the%20doNotEndorseStrictVersions%20method.-,Importing%20Maven%20BOMs,the%20enforcedPlatform%20keyword%2C%20instead%20of%20platform%2C%20when%20importing%20the%20BOM%3A,-Example%2021.%20Importing) would solve my question? – Joo Hyuk Kim Dec 13 '21 at 14:42

1 Answers1

4

The io.spring.dependency-management plugin provides a task, dependencyManagement, that could be used to find all the managed dependencies and their versions.

$  gradle dependencyManagement

> Task :dependencyManagement

------------------------------------------------------------
Root project
------------------------------------------------------------

global - Default dependency management for all configurations
    antlr:antlr 2.7.7
    ch.qos.logback:logback-access 1.2.10
    ch.qos.logback:logback-classic 1.2.10
    ch.qos.logback:logback-core 1.2.10
    com.atomikos:transactions-jdbc 4.0.6
    com.atomikos:transactions-jms 4.0.6
    org.springframework:spring-core 4.1.5.RELEASE
    .....

Gayan Weerakutti
  • 11,904
  • 2
  • 71
  • 68