This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-13
Channels
- # announcements (27)
- # beginners (184)
- # boot (4)
- # cider (9)
- # cljdoc (1)
- # cljsrn (2)
- # clojure (208)
- # clojure-austin (1)
- # clojure-conj (4)
- # clojure-dev (20)
- # clojure-europe (15)
- # clojure-italy (66)
- # clojure-losangeles (2)
- # clojure-nl (32)
- # clojure-spec (64)
- # clojure-uk (80)
- # clojurescript (50)
- # cursive (2)
- # data-science (3)
- # datomic (17)
- # emacs (1)
- # events (6)
- # fulcro (3)
- # jobs (15)
- # juxt (5)
- # klipse (2)
- # leiningen (31)
- # nyc (3)
- # off-topic (34)
- # re-frame (2)
- # reagent (9)
- # schema (1)
- # shadow-cljs (52)
- # specter (5)
- # sql (3)
@frozenlock the Uberjar does end up there.
@mikerod I forgot to mention: with profiles. :target-path
in a profile is respected for compilation, but not for the uberjar.
@frozenlock which profile is it? How are you running the uberjar task to include this profile?
:target-path "target/%s"
:profiles {:uberjar {:aot :all
:omit-source true
:auto-clean false}
:dev {:plugins [[lein-shell "0.5.0"]]}
;; profiles to generate test uberjars
:updater-test {:uberjar-name "updater.jar"
:target-path "target/test/lifecycle/updater"
:main updater.updater}
:main-app-test {:uberjar-name "main-app.jar"
:target-path "target/test/lifecycle/main_app"
:main updater.updater}}
:aliases
{"test-lifecycle" ["do" "clean," "with-profile" "updater-test:main-app-test" "uberjar"]}
Then lein test-lifecycle
Uberjars are put into target/uberjar
instead of target/test/...
.
@frozenlock maybe because the profiles aren’t marked with :leaky
https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#profile-metadata
Follow-up : adding ^:leaky
fixes the issue. Thanks!
@frozenlock ok, good. it’s a bit frustrating to me still
this was your actual project.clj setup right? you weren’t using “composite” or “partially composite” profiles too?
like did you have a :profiles
that composite-style merged in :updater-test
and/or :main-app-test
?
Yes, it was the actual setup.
what version of lein
too? just to be cleear @frozenlock
Leiningen 2.9.1 on Java 11.0.4 OpenJDK 64-Bit Server VM
Just to be clear: everything in the profile appears to be kept (including uberjar-name), but the generated uberjar is in the wrong directory.
but ok, so :leaky
maybe just giving it higher priority in some profile merge step later
@frozenlock sorry to drill with questions, but did the “normal” jar file end up in the correct :target-path
, but not the uberjar? or did both jars ignore your :target-path
?
Normal jars behave as expected. It's really just the uberjar that was ending at the wrong (uberjar profile) :target-path
.
I don’t know the whole reason still, but I suspect it’s because the :uberjar
profile is perhaps auto-marked as :leaky