Reputation:
I have the problem. I have undesired dependency, that is not included explicitly in the gradle file. I cannot figure out how to find which dependency transitively includes this one.
How can I find out where does this dependency come from ?
I have tried
gradlew analyze
But fails to compile my project
Thanks
Upvotes: 5
Views: 2985
Reputation: 4923
dependencyInsight
task can do this for you. Example:
gradle -q lib:dependencyInsight --dependency groovy --configuration compile
or for Android
gradlew -q app:dependencyInsight --dependency gson --configuration debugCompileClasspath
Will show why dependency containing groovy
in its name is included in compile
configuration of the lib
project. See this doc section for details
Upvotes: 7