How do I prevent dev profiles dependencies from being pulled into the pom? I have something like
:profiles
{:test-build {:main foo.bench
:aot :all}
:dev
[:bench :prof :cli
{:source-paths ["analysis"]
:dependencies
[[incanter "1.9.3"]]}]
:cli {:dependencies [[org.clojure/tools.cli "0.4.2"]]}
:bench {:source-paths ["bench"]
:dependencies [[criterium "0.4.5" :scope "provided"]
[org.clojure/test.check "0.9.0"]]}
:prof {:source-paths ["prof"]
:dependencies [[com.clojure-goes-fast/clj-async-profiler "0.4.0"]]}}
but when I run lein pom
those deps are added. another project requires this one and builds an uberjar it will also pull in the dev dependencies. A workaround I found is marking them as provided but that doesn't seem like the right solution, more like abusing a featurei think you can do with-profiles -dev
. ideally you could do with-profile release
without a plus or minus to dictate the single profile. there are a few that default if i remember correctly
Isn't it weird that a pom would pull dev dependencies in? looks like a bug
i think running lein
pulls in default profiles. i agree that individual tasks should not do this but it happens at the top level before knowing what the task is i bet
It seems weird enough to open a ticket imo. I'll use -dev in the meanwhile, thanks 🙂
be aware there are still a few other profiles by default i think.
looking at the profiles documentation now: In order to prevent profile settings from being propagated to other projects that depend upon yours, the `:default` profiles are removed from your project when generating the pom, jar, and uberjar, and an `:uberjar` profile, if present, is included when creating uberjars. (This can be useful if you want to specify a `:main` namespace for uberjar use without triggering AOT during regular development.) Profiles activated through an explicit `with-profile` invocation will be preserved.
From that I gather it should not be included :thinking_face:
weird
what version? might be a regression
2.9.4
downgraded all the way to 2.9.0, found in every version hence
even in 2.7.1
wait, no, tested badly, works well in 2.7.1
works in 2.8.3
aha! regression in 2.9.2