Search code examples
scaladependenciessbt

How to see dependency tree in sbt?


I am trying to inspect the SBT dependency tree as described in the documentation:

sbt inspect tree clean

But I get this error:

[error] inspect usage:
[error]   inspect [uses|tree|definitions] <key>   Prints the value for 'key', the defining scope, delegates, related definitions, and dependencies.
[error]
[error] inspect
[error]        ^

What is wrong? Why doesn't SBT build the tree?


Solution

  • When run from the command line, each argument sent to sbt is supposed to be a command, so sbt inspect tree cleanwill:

    • run the inspect command,
    • then run the tree command,
    • then the clean command

    This obviously fails, since inspect needs an argument. This will do what you want:

    sbt "inspect tree clean"