leiningen

grav 2023-01-10T09:20:00.816349Z

Reading https://cljdoc.org/d/leiningen/leiningen/2.9.3/doc/profiles#activating-profiles it seems that dependencies aren't merged across profiles by default, but that's not what I'm seeing. If I have this simple project.clj:

(defproject lein-fun "0.1.0-SNAPSHOT"
  :dependencies [[clj-time "0.15.2"]]
  :profiles {:my-profile {:dependencies [[cheshire "5.10.2"]]}})
and run
$ lein with-profile my-profile deps :tree
I still get [clj-time "0.15.2"] as one of the top-level nodes. Am I misunderstanding the docs? Is there a way that I can exclude the "default" dependencies?

2023-01-10T16:37:00.495269Z

:dependencies by default are merged - I think nearly all keys in profiles are default merged

2023-01-10T16:37:16.387779Z

You typically have to explicitly opt-out of that sort of behavior. Not sure where you think the docs say otherwise.

2023-01-10T16:37:30.405589Z

(defproject lein-fun "0.1.0-SNAPSHOT"
  :dependencies [[clj-time "0.15.2"]]
  :profiles {:my-profile {:dependencies ^:replace [[cheshire "5.10.2"]]}})
to not merge it; or rather have your profile :dependencies override/replace during the merge instead of merging the dep vectors