This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-21
Channels
- # announcements (1)
- # aws (18)
- # babashka (5)
- # beginners (72)
- # biff (2)
- # calva (38)
- # cider (2)
- # clj-commons (6)
- # clj-yaml (2)
- # clojars (7)
- # clojure (41)
- # clojure-austin (5)
- # clojure-europe (78)
- # clojure-nl (1)
- # clojure-norway (18)
- # clojure-uk (3)
- # clojurescript (13)
- # component (9)
- # cursive (37)
- # datahike (3)
- # datomic (7)
- # fulcro (7)
- # graphql (3)
- # holy-lambda (2)
- # honeysql (8)
- # introduce-yourself (1)
- # jobs (1)
- # kaocha (1)
- # leiningen (19)
- # lsp (104)
- # malli (5)
- # nbb (8)
- # off-topic (60)
- # polylith (22)
- # portal (2)
- # reagent (24)
- # reveal (1)
- # shadow-cljs (126)
- # test-check (11)
- # tools-build (39)
- # vim (23)
- # xtdb (10)
how do I get my "prod classpath" in lein?
I'm using :test-paths ["test"]
and when I run lein classpath
it includes my test
dir. This is not what I expect.
Update: even without :test-paths ["test"]
, with a almost empy project.clj, it includes test
in my lein classpath
(I haven't tried it)
I thiiiink the classpath
command had some oddities that would make it still include stuff that shouldn't
you could also add +uberjar
to the mix (although it's quite rare to add deps only in the :uberjar profile)
lein show-profiles
shows every profile in the project
After a
lein with-profiles -auth,-base,-checkout,-debug,-default,-leiningen/default,-leiningen/test,-offline,-uberjar,-update,-user classpath | tr ':' '\n' | head
(removing all profiles)
it still prints "test" directory 😞
...it's hardcoded.
you can have a profile named blank-test-paths
that does a :test-paths ^:replace []
Is it correct to assume that if I have specified a version for a dependency defined in project.clj
and multiple versions installed in ~/.m2
lein should pick the version I have specified? I ask because people on my team, myself included, have seen that installing a newer version of clojure.java-time
in a project that depends on an earlier version ends up using the newer one (which is incompatible in our case).
you can start a REPL and run this code
(for [i ["java_time/api.clj"
"java_time/api.class"
"java_time/api.cljc"]
f (enumeration-seq
(.getResources
(.getContextClassLoader (Thread/currentThread))
i))]
(str f))
It should result in a list with 1 single element
that starts with jar:file
, and contains the java-time version@U2J4FRT2T thanks, it shows what I would expect, so I'll need to dig in deeper to understand what exactly is going on.
lein deps :tree
can help you in two ways:
• show which other dep might be depending on the different clojure.java-time version
• explictly inform you of such ambiguities (you can always ban them by setting :pedantic? :abort
in your project
I consider :pedantic?
a basic tenet of a nicely maintained project :)