9

I am using sbt 0.12 RC2.

My project has a bunch of library dependencies, and some of these trigger other dependencies. Some of these dependencies are unmanaged (in lib/), some are in my local .ivy2 repository, some are found in various remote repositories.

I'm looking for an sbt update-verbose or similar that will tell me exactly where sbt found each JAR file when it says:

[info] Resolving com.nicta#sbt-scoobi;0.0.1 ...
[info] Resolving org.scala-lang#scala-library;2.9.2 ...
[info] Resolving org.apache.opennlp#opennlp-maxent;3.0.1-incubating ...
[info] Resolving jwnl#jwnl;1.3.3 ...
Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
Urban Vagabond
  • 7,282
  • 3
  • 28
  • 31
  • related: https://stackoverflow.com/questions/21111989/how-to-find-out-which-dependency-caused-a-particular-library-to-be-downloaded – Matt Aug 13 '16 at 10:03

4 Answers4

5

sbtgenerates a very extensive report on how exactly the dependencies were resolved in target/resolution-cache/reports. Open one of the .xml files in a web browser, and you should see all the detail you need.

lutzh
  • 4,917
  • 1
  • 18
  • 21
3

I'm not sure if this applies to sbt 0.12.x, but in 0.13.x, if you can find where your library lives in in the ~/.ivy/cache/... directory structure, the library's parent directory has a file named ivydata-x.y.z.properties which contains the URL where it found the dependency.

For example, if you cache for akka-streams looks like this:

.ivy2
└── cache
    └── com.typesafe.akka
        └── akka-stream_2.11
            ├── docs
            │   └── akka-stream_2.11-2.4.14-javadoc.jar
            ├── jars
            │   └── akka-stream_2.11-2.4.14.jar
            └── srcs
                └── akka-stream_2.11-2.4.14-sources.jar

you should find a file like this, containing download URL:

.ivy2
└── cache
    └── com.typesafe.akka
        └── akka-stream_2.11
            └──ivydata-2.4.14.properties
metasim
  • 4,793
  • 3
  • 46
  • 70
1

You can use show compile:dependency-classpath to show where the depedencies are

Guillaume Massé
  • 8,004
  • 8
  • 44
  • 57
  • That doesn't give me what I'm looking for. It just lists the Java classpath. I'd like to know, e.g. for a dependency `com.nicta#sbt-scoobi;0.0.1`, where it actually came from (e.g. the unmanaged `lib/` directory, the local `~/.ivy2` repository, the local `~/.m2` repository, a specific remote Ivy2 or Maven repository, etc.). – Urban Vagabond Aug 05 '12 at 21:44
  • `Attributed(/Users/guillaume/.ivy2/cache/org.specs2/specs2_2.9.1/jars/specs2_2.9.1-1.11.jar)` so this one is from `~/.ivy2` – Guillaume Massé Aug 05 '12 at 23:34
  • 3
    No, that's the cache. That's not the source. It doesn't tell you whether it originated locally or remotely, or where from. – Urban Vagabond Aug 08 '12 at 13:52
0

The details of the last task can be recalled by running last

Details and more info here:

Configure and use logging

Somatik
  • 4,723
  • 3
  • 37
  • 49