This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-26
Channels
- # announcements (17)
- # babashka (68)
- # beginners (8)
- # biff (14)
- # calva (25)
- # cherry (10)
- # clj-kondo (1)
- # clj-on-windows (12)
- # cljsrn (6)
- # clojure (134)
- # clojure-berlin (1)
- # clojure-europe (33)
- # clojure-nl (4)
- # clojure-norway (6)
- # clojure-uk (10)
- # clojurescript (9)
- # datalevin (8)
- # datomic (34)
- # docker (1)
- # emacs (31)
- # fulcro (6)
- # honeysql (8)
- # java (7)
- # joyride (14)
- # kaocha (7)
- # malli (11)
- # nbb (4)
- # off-topic (11)
- # pedestal (14)
- # rdf (53)
- # re-frame (6)
- # reagent (39)
- # reitit (2)
- # releases (9)
- # rewrite-clj (14)
- # shadow-cljs (97)
- # specter (1)
- # testing (5)
- # tools-deps (12)
- # vim (4)
- # xtdb (9)
what does it mean to create multiple jars instead of a single uberjar? how do they interact? How do you deploy? The mental model for an uberjar is pretty easy: everything's in one place and is updated together. But when building multiple jars in multiple sub projects (of a java or clojure app), I struggle to understand how it all works together. If anyone has articles or blog posts that talk about this, I'd love to read them.
if you're deploying, then you need the N jars on the classpath. so, you can gather them up and deploy them onto a server, then put them on the classpath. If you start with java
directly, there is limited wildcard support on the classpath so you can just java -cp libs/* my.Main
Oh, right, then the jars just act like dependencies/namespaces and your code sees them by the same means clojure code sees another namespace (because clojure effectively relies on java's resolution system). Okay, that makes sense. I was thinking of, like, binary executables that don't have their internals exposed but this makes more sense.
this makes it possible to update just things that change at finer-grain (Datomic ions does some stuff like this under the hood), but is maybe more cumbersome than it's worth for most deployments
The app would still have to restart, but you'd only have to ship the single jar? Or can you do hot-reloading with jars?
without something special, you would need to restart (there are capabilities for hot loading via java agents, but lots of caveats there)
cool, thanks for the help