This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-19
Channels
- # announcements (52)
- # asami (83)
- # atom-editor (1)
- # babashka (143)
- # beginners (123)
- # calva (18)
- # chlorine-clover (21)
- # cider (7)
- # clj-kondo (57)
- # cljs-dev (4)
- # clojure (209)
- # clojure-boston (1)
- # clojure-europe (27)
- # clojure-germany (12)
- # clojure-italy (17)
- # clojure-nl (3)
- # clojure-serbia (6)
- # clojure-spec (1)
- # clojure-uk (59)
- # clojurescript (82)
- # conjure (9)
- # core-async (6)
- # cursive (20)
- # data-science (1)
- # datahike (1)
- # datascript (1)
- # datomic (86)
- # duct (5)
- # emacs (6)
- # events (6)
- # figwheel-main (4)
- # fulcro (27)
- # graalvm (19)
- # leiningen (14)
- # lsp (30)
- # malli (48)
- # meander (3)
- # off-topic (6)
- # pedestal (2)
- # practicalli (1)
- # rewrite-clj (21)
- # shadow-cljs (18)
- # sql (15)
- # tools-deps (9)
- # vim (3)
- # wasm (3)
- # xtdb (18)
Hi,
What's the reason lein deps
does not retrieve the ring-codec jar when I do not explicitly mention ring-codec as a dependency in project.clj
? Because of this lein run
has to retrieve the jar first which deteriorates startup time. Is including ring-codec in project.clj the best way to prevent this?
$ lein deps # ring-codec not included as dependency in project.clj
Retrieving ring/ring-codec/1.1.2/ring-codec-1.1.2.pom from clojars
$ rm -rf ~/.m2/repository/ring/ring-codec/1.1.2
$ lein deps # ring-coded included as dependency in project.clj
Retrieving ring/ring-codec/1.1.2/ring-codec-1.1.2.pom from clojars
Retrieving ring/ring-codec/1.1.2/ring-codec-1.1.2.jar from clojars
@uiltjesrups you need to have all deps pulled your project uses. these are not limited to only those you directly/explicitly specify in your project.clj. you also have to pull in all of your dependencies’ depencencies, and transitively all of theirs
lein shouldn’t need to pull this every time under standard setup since it caches it to your local repository - on the machine lein is ran
@uiltjesrups that situation makes me think your run
task uses some plugin adding deps that the default project doesn't include
I never call "lein deps", it's a subtask that nearly every other task calls for you
@noisesmith Thanks, it might be the lein duct plugin, I will try it out. I use lein deps
in my dockerfile, so all dependencies are pulled during building the image.
if you build a fat jar instead of using lein inside the docker image, you don't have to worry about any of that
(also you get better startup time and a simpler container setup)
also this allows switching painlessly to clj (or whatever else gets invented), as all you need inside the container for the clojure code to work is a jvm and a jar
I started with that but ran into problems (long story) and lein run was a quick solution, I thought... You convinced me to do it the right way anyway. Thanks!
note that using an uberjar does not require aot - you can use clojure.main
When trying to start lein repl
I get the error message Caused by: java.lang.RuntimeException: Unable to resolve symbol: create in this context
. Does anyone know what I might be doing wrong?