Sbt equivalent to maven's dependency:tree

5,272 views
Skip to first unread message

Quartz

unread,
Jan 6, 2011, 6:54:14 PM1/6/11
to simple-build-tool
Is there a way to find out how is a certain jar is included (it's a
transitive dependency)?

Optimal would be something like maven's dependency:tree...

Best regards,

Gus

Jason Zaugg

unread,
Jan 7, 2011, 4:16:04 AM1/7/11
to simple-b...@googlegroups.com
Ivy produces HTML reports [1] that should answer this question. I can't test this now, but I think you can run

>debug
>update

and look through the detailed output for the location of the ivy report, somewhere under ~/.ivy2

-jason

Yasushi

unread,
Jan 7, 2011, 5:05:50 AM1/7/11
to simple-build-tool
I wrote resolve task.

lazy val resolve = resolveTask
def resolveTask = task {
updateIvyModule.withModule{ (i,m,c) =>
i.resolve(m, new org.apache.ivy.core.resolve.ResolveOptions) }
None
}

Mark Harrah

unread,
Jan 7, 2011, 10:47:38 AM1/7/11
to simple-b...@googlegroups.com

Are you aware that 'update' is resolve followed by a retrieve and so doing an 'update' includes doing a resolve?

-Mark

Gustavo Hexsel

unread,
Jan 7, 2011, 11:12:53 AM1/7/11
to simple-b...@googlegroups.com
  It's a bit awkward to use (the list is broken down by inclusion type, there is a lot of noise), but it works.

  Thanks!



--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.


Jason Zaugg

unread,
Jan 28, 2011, 4:53:01 AM1/28/11
to simple-b...@googlegroups.com
Could you post full instructions on where you found the IVY HTML report? I did it once before, but can't repeat the feat.

-jason

Gustavo Hexsel

unread,
Jan 28, 2011, 12:09:54 PM1/28/11
to simple-b...@googlegroups.com
  Activate debug and do an update.  You may or may not want to clean-lib as well (will purge ivy's cache):

sbt debug update 

  Then look at .ivy2/cache/, there will be a gazillion files with the resolution of each scope for each library, for instance we had an artifact called xmatters.com % shared % 1.0-snapshot, and the report creates files like resolved-xmatters.com-shared_2.8.1.xml.  There are also , xmatters.com-shared_2.8.1-test.xml, xmatters.com-shared_2.8.1-compile.xml, etc, but I don't know the purpose of those, they seem to contain more info.

  Having said that, mvn dependency:tree provides a much simpler way of seeing it.  If I get some time, I'll look at how I can generate this (hard, other than sbt I never used ivy before - but I do have a healthy aversion to ANT, which irrationally rubs onto ivy).



On Fri, Jan 28, 2011 at 1:53 AM, Jason Zaugg <jza...@gmail.com> wrote:
Could you post full instructions on where you found the IVY HTML report? I did it once before, but can't repeat the feat.

-jason

--

Richard Wallace

unread,
Jan 31, 2012, 9:20:43 PM1/31/12
to simple-b...@googlegroups.com
What version of sbt is that for? Using 0.11.2 there doesn't seem to
be a 'debug' task.

> debug
[error] Not a valid command: debug
[error] Not a valid project ID: debug
[error] Not a valid configuration: debug
[error] Not a valid key: debug
[error] debug
[error] ^


Rich

Adam Warski

unread,
Aug 27, 2015, 11:25:04 AM8/27/15
to simple-build-tool
That's a very old thread, but if somebody would find that useful, there are two options now:

* SBT plugin for generating textual (and graphical, using an external viewer) representations of the dependency tree: https://github.com/jrudolph/sbt-dependency-graph
* UpdateImpact: graphical, searchable representation of the dependency tree (including all modules from your project, transitive dependencies and eviction information): https://app.updateimpact.com (free service). Disclaimer: I'm one of the developers of the site

Adam

Naftoli Gugenheim

unread,
Aug 31, 2015, 2:49:26 PM8/31/15
to simple-build-tool

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.

To post to this group, send email to simple-b...@googlegroups.com.

Adam Warski

unread,
Sep 1, 2015, 5:24:42 AM9/1/15
to simple-b...@googlegroups.com
Ah, good to know we aren’t the only ones for who the ASCII trees were frustrating :)

It’s always good to have alternatives, on one hand your plugin works locally, on the other hand with UpdateImpact you can quite easily search and navigate the tree, something that (at least for me) is very useful when hunting down bugs caused by incompatible libraries or when updating a library. And we have quite a lot of plans on extending the analysis of the dependency tree :)

Adam

You received this message because you are subscribed to a topic in the Google Groups "simple-build-tool" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simple-build-tool/GJp_CxcDmpo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simple-build-t...@googlegroups.com.

To post to this group, send email to simple-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages