How to disable dependency resolution during 'package' in sbt
Asked Answered
S

1

6

We have project with multiple subprojects and complex inter-dependencies. Subprojects share similar sets of external dependencies (Spring, Apache etc).

It take enormous amount of time for dependencies resolution (possibly because of redundant dependencies checks) even in offline mode.

How to solve this? How can we disable updating and re-resolving external dependencies during packaging.

version: 0.12.1

Sway answered 31/1, 2013 at 13:37 Comment(3)
Which version of SBT are you using? As of 0.11, even projects with massive dependencies (I have them) handle the automatic update check efficiently. Only when you do it explicitly (force it) does it take a long time.Curagh
0.12.1. it doesn't happens every time, but when it occurs - it's tooo long, because it checks same dependencies for every depend subprojectSway
actually our problem is that we have dependency to internal project in ivy/nexus - so every time it changes (it changes very often) we have new resolving. Same after branch change in Git.Sway
A
2

skip in update := true will prevent update from doing any work. It uses the results of the previous update instead.

Note that this means that update must have been run (possibly indirectly) since the last clean, changes to dependency configuration since the last run will be ignored, and the cache must still contain the jars from the previous update.

Running update directly will override the skip setting and cause update to run normally.

Finally, similar sets of dependencies doesn't necessarily mean dependency resolution will be any faster. It only means that network access, downloading, and metadata parsing shouldn't be done more than once per dependency.

Audy answered 2/2, 2013 at 17:19 Comment(1)
in which file do i have to metione ` skip in update := true `Evacuation

© 2022 - 2024 — McMap. All rights reserved.