This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-15
Channels
- # adventofcode (80)
- # beginners (94)
- # biff (19)
- # cider (74)
- # clj-kondo (11)
- # cljs-dev (7)
- # clojure (110)
- # clojure-austin (3)
- # clojure-australia (1)
- # clojure-belgium (1)
- # clojure-china (1)
- # clojure-europe (83)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (4)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # cursive (3)
- # data-science (8)
- # datalevin (8)
- # emacs (18)
- # etaoin (5)
- # graalvm (1)
- # holy-lambda (3)
- # honeysql (1)
- # jackdaw (10)
- # java (10)
- # jobs (3)
- # luminus (9)
- # malli (106)
- # off-topic (88)
- # polylith (8)
- # portal (2)
- # re-frame (50)
- # reagent (11)
- # reitit (74)
- # remote-jobs (1)
- # shadow-cljs (46)
- # tools-deps (26)
- # xtdb (49)
is it possible when creating a basis for a jar to exclude a dependency and if so, how? Tried manually fiddling with the generated basis but that was tedious and seemed error-prone.
What does “for a jar” mean? Is this in tools.build context?
Is this a top level dep or a dependency?
If top, you could I think add an :extra {the/lib nil}
in the basis opts
Or if modifying the basis after, the critical part is the :libs and you could just remove the lib from that map
like this?
(b/create-basis {:project "deps.edn" :extra {'io.github.nextjournal/dejavu nil}})
clj -T:build jar
Producing jar: target/clerk-0.12.707.jar
Skipping coordinate: {:git/sha 31bdc12d78d3a8f48cbd6c3df5b8c79ca88df4f1, :git/url , :deps/manifest :deps, :deps/root /Users/mk/.gitlibs/libs/io.github.nextjournal/dejavu/31bdc12d78d3a8f48cbd6c3df5b8c79ca88df4f1, :parents #{[]}, :paths [/Users/mk/.gitlibs/libs/io.github.nextjournal/dejavu/31bdc12d78d3a8f48cbd6c3df5b8c79ca88df4f1/src]}
yeah getting `Bad coordinate for library io.github.nextjournal/dejavu, expected map: nil
(def basis (-> (b/create-basis {:project "deps.edn"})
(update :libs dissoc 'io.github.nextjournal/dejavu)))
Deps is really a compositional model so excluding things is a lot harder than including them. I thought I had something for the above in there but I guess not. I assume this isnt a dep that could optionally be included rather than excluded?
in that case I want to have it be there when consumed at as git dep but leave it out when I build the jar
This is a dependency that does some stuff at startup when in local dev or as a git dep, but as a mvn jar we would like to not use it since we can pre-compute what this lib is doing and also exclude the deps
add-lib3
doesn't work if you are using lein-tools-deps
. Just logging that here so that it can be found using a search. 😃 I spent way too much time trying to figure out what was going on. The symptoms were that I got an error complaining that the jar wasn't found. If I download it to my .m2
directory, it works adding it, so it seems to be the download that does not happen.