Silly question, what does override-deps do that extra-deps doesn't? I realized I've been using extra-deps in my deps.edn when I want to override a dep.
override replaces, extra adds
override does not add
that is, it is ignored if you don't already have the lib
I guess it would be more accurate to say override replaces and extra adds or replaces
further refining... • extra adds new top-level deps (which may effectively replace existing top or transitive deps) • override replaces the version of an existing top or transitive dep
in both cases, you should be guaranteed to get the version you've said - in extra, because it's at the top level, and in override because it replaces at all levels
@dominicm For a concrete use case, we use :override-deps
heavily at work to "pin" versions of libraries across our entire repo. If a particular app doesn't use a given dependency, the :override-deps
does nothing. For deps we expect to be overridden, we specify the coords as just {}
(since they'll be supplied via the override). Does that help?
In a community context: https://github.com/seancorfield/dot-clojure/blob/master/deps.edn#L4-L17 -- those aliases let you pick a specific version of Clojure by overriding whatever would otherwise be pulled in.
Cool, thanks for both your input. 😁