如何找出导致下载特定库的依赖项? [英] How to find out which dependency caused a particular library to be downloaded?
问题描述
运行我的 SBT 项目时,控制台输出中有一行:
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)
如何找出是哪个项目依赖导致netty.jar被下载?
How to find out which project dependency caused the netty.jar to be downloaded?
推荐答案
这个插件应该能够帮助:https://github.com/jrudolph/sbt-dependency-graph/
This plugin should be able to help: https://github.com/jrudolph/sbt-dependency-graph/
另一种方法是在您的 build.sbt
中打开完整调试,如下所示:
Another way would be to turn on full debug in your build.sbt
as follows:
ivyLoggingLevel := UpdateLogging.Full
logLevel := Level.Debug
然后你可以解析sbt update
例如,如果我想知道示例项目中 logback-core
的来源,我可以运行
For example, If I wanted to know where logback-core
comes from in my sample project, I could run
sbt update | grep logback-core
我会得到多条这样的行,告诉我它带有 logback-classic
:
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(*)]
这篇关于如何找出导致下载特定库的依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!