Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is `Resolving` so slow in the compiling stage of SBT?

I found the Resolving step usually takes long time when I run sbt compile, such as this

[info] Resolving org.sonatype.oss#oss-parent;7 ...

Does anyone have ideas about what the resolving actually mean? And why is it necessary?

like image 355
Hanfei Sun Avatar asked Feb 27 '15 14:02

Hanfei Sun


1 Answers

It is when ivy (which sbt uses for dependency management) looks through the dependency graph of the project to figure out all dependencies and transitive dependencies, and resolve any conflicts between those, for example, two dependencies might depend on different versions of the same library.

The result is cached, but is removed if you do a clean, so it will be recalculated on the next operation that needs to know the dependencies.

It is also possible to configure your project in ways which it so that sbt cannot cache the result but needs to redo those calculations every time you build, for example if you depend on snapshots and have configured sbt to update snapshots for every build.

like image 161
johanandren Avatar answered Nov 10 '22 11:11

johanandren