This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-11
Channels
- # announcements (15)
- # aws (11)
- # babashka (13)
- # babashka-sci-dev (2)
- # beginners (63)
- # calva (20)
- # cider (9)
- # clj-kondo (27)
- # clojars (3)
- # clojure (34)
- # clojure-art (4)
- # clojure-europe (21)
- # clojure-filipino (1)
- # clojure-indonesia (1)
- # clojure-my (1)
- # clojure-nl (11)
- # clojure-norway (10)
- # clojure-sg (1)
- # clojure-spec (4)
- # clojure-uk (4)
- # clojurescript (5)
- # cursive (8)
- # deps-new (2)
- # events (1)
- # exercism (2)
- # fulcro (44)
- # graphql (6)
- # gratitude (1)
- # introduce-yourself (1)
- # jobs (3)
- # leiningen (5)
- # lsp (26)
- # membrane (18)
- # missionary (9)
- # off-topic (1)
- # pedestal (5)
- # portal (1)
- # quil (24)
- # re-frame (17)
- # reagent (5)
- # remote-jobs (2)
- # reveal (3)
- # spacemacs (4)
- # tools-build (1)
- # tools-deps (12)
I’m trying to extract classpaths from leiningen-built uberjars, and my current method is to use maven to unpack the pom.xml
from within the META-INF
folder of the uberjar and build the classpath from there. However, I’m running into an issue where the generated pom.xml
doesn’t include all dependencies. With a project like
:dependencies [[my-org/project-A "1.0.0"]]
:profiles {:my-profile {:dependencies [[my-org/project-B "1.0.0"]]}}
:aliases {"my-uberjar" ["do" ["with-profiles" "my-profile" "uberjar"]]
running lein my-uberjar
creates an uberjar with a pom.xml
in the respective META-INF
directory that mentions project-A
but not project-B
. This is also visible when running lein pom
and lein with-profiles my-profile pom
. I don’t have a very deep understanding of either of these tools, so perhaps someone can let me know if some of my expectations are incorrect?
• lein with-profiles <profile> pom
creates a pom.xml
with the specified profile’s configuration
• lein with-profiles <profile> uberjar
creates an uberjar according to the specified profiles, putting a pom.xml
in the uberjar at META-INF/maven/<group-id>/<artifact-id>/pom.xml
. This pom.xml
is created by the same machinery as lein with-profiles <profile> pom
, so should contain the specified profile’s configurationI should mention, this is mostly for my own edification at this point. There are other more direct ways of doing what I’m going for without needing to extract classpaths from jars.
so apparently one issue is that i need the profile there to be marked ^:leaky
(see https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#profile-metadata) for its info to be included in the pom.xml
. also in my actual setup there is an :aot
in the my-profile
profile that might be confounding things, which allows the uberjar to be built correctly with project-B
but the pom to omit that dependency
(credits @U0LK1552A)