Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT dependency-tree

Tags:

scala

sbt

I am trying to see the entire SBT tree, but when I run sbt dependency-tree, I do not receive any results (after a minute or so of processing).

How can this be resolved?

Thanks Nir

like image 349
Nir Ben Yaacov Avatar asked Sep 03 '17 11:09

Nir Ben Yaacov


People also ask

What is sbt dependency?

SBT Dependencies Eventually, a project can suffer from the JAR dependency hell. This problem can be described as a situation where multiple versions of the JARs coexist in the classpath. This results in the ClassLoader loading the first class found from the JAR, with very unexpected results at runtime.

Where are sbt dependencies?

If you have JAR files (unmanaged dependencies) that you want to use in your project, simply copy them to the lib folder in the root directory of your SBT project, and SBT will find them automatically.

How do we specify library dependencies in sbt?

The libraryDependencies key Most of the time, you can simply list your dependencies in the setting libraryDependencies . It's also possible to write a Maven POM file or Ivy configuration file to externally configure your dependencies, and have sbt use those external configuration files.

Does sbt use coursier?

sbt 1.3. x ships with coursier support out-of-the-box, and that support is enabled by default. You shouldn't need to add sbt-coursier to sbt 1.3. x builds in most cases.


1 Answers

You can use this plugin to show a nice dependency tree/graph of your build dependencies. In your plugins.sbt file, add the following line:

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2")

Then after that, do sbt clean compile for the plugin to take effect. Then in your terminal, execute sbt dependencyTree or any other command specified in this link.

Hope that helps!

like image 62
Sohum Sachdev Avatar answered Oct 05 '22 23:10

Sohum Sachdev