How to find out which dependency caused a particular library to be downloaded?

sbt, scala

Solution

This plugin should be able to help: https://github.com/jrudolph/sbt-dependency-graph/

Another way would be to turn on full debug in your `build.sbt` as follows:

ivyLoggingLevel := UpdateLogging.Full
logLevel := Level.Debug

and then you could parse the output of `sbt update`

For example, If I wanted to know where `logback-core` comes from in my sample project, I could run

sbt update | grep logback-core

And I would get multiple such lines, telling me that it comes with `logback-classic`:

[debug] == resolving dependencies ch.qos.logback#logback-classic;1.0.10->ch.qos.logback#logback-core;1.0.10 [compile->master(*)]

Problem

When runing my SBT project, there is a line in console output: ``` [info] downloading http://repository/nexus/content/groups/public/org/jboss/netty/netty/3.2.3.Final/netty-3.2.3.Final.jar ... [info] [SUCCESSFUL ] org.jboss.netty#netty;3.2.3.Final!netty.jar(bundle) (651ms) ``` How to find out which project dependency caused the netty.jar to be downloaded?

Original source