Why does sbt do permission for all dependencies when only one has changed?

When I change one of the project dependencies, sbt starts the resolution for all the dependencies (not only those that have been changed). This is especially time consuming when such excess resolution is performed for each project in a multi-module project.

Why does sbt do such excessive resolution? Is there a way to make the solution more intelligent?

+4
source share
1 answer

The main reason is that sbt needs to resolve conflicts. Not only this, but ivy often needs to resolve all -SNAPSHOT dependencies to ensure its current information. This is because by default sbt uses the "last" conflict resolution manager, rather than the "closest" used by maven. This, in my experience, leads to fewer issues with artifact versions. However, this means, as Mark points out, that he recreates the entire depot tree.

All permissions in sbt are delegated to ivy. To make it more intelligent, you will have to create hooks for Ivy or otherwise replace the dependency management library used by sbt. In this case, permissions, I think, the only thing that can be done is to improve the cache in order to reduce the time taken to restore the previous information about caching the artifact.

+1
source

Source: https://habr.com/ru/post/1487511/


All Articles