tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
dominicm 2020-05-21T20:37:53.135Z

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.

alexmiller 2020-05-21T20:46:43.135200Z

override replaces, extra adds

alexmiller 2020-05-21T20:46:57.135400Z

override does not add

alexmiller 2020-05-21T20:47:09.135700Z

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

alexmiller 2020-05-21T20:49:04.136400Z

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

alexmiller 2020-05-21T20:51:09.138100Z

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

alexmiller 2020-05-21T20:52:04.139100Z

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

seancorfield 2020-05-21T21:29:34.141Z

@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?

seancorfield 2020-05-21T21:31:25.142Z

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.

dominicm 2020-05-21T21:35:49.142500Z

Cool, thanks for both your input. 😁