Fork me on GitHub

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.

Alex Miller (Clojure team)20:05:43

override replaces, extra adds

Alex Miller (Clojure team)20:05:09

that is, it is ignored if you don't already have the lib

Alex Miller (Clojure team)20:05:04

I guess it would be more accurate to say override replaces and extra adds or replaces

Alex Miller (Clojure team)20:05:09

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

Alex Miller (Clojure team)20:05:04

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: -- those aliases let you pick a specific version of Clojure by overriding whatever would otherwise be pulled in.


Cool, thanks for both your input. 😁