leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
Ben Sless 2020-12-23T16:44:51.136600Z

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 feature

dpsutton 2020-12-23T16:46:45.137700Z

i 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

Ben Sless 2020-12-23T16:49:19.137800Z

Isn't it weird that a pom would pull dev dependencies in? looks like a bug

dpsutton 2020-12-23T16:50:28.138Z

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

Ben Sless 2020-12-23T17:01:11.138200Z

It seems weird enough to open a ticket imo. I'll use -dev in the meanwhile, thanks 🙂

dpsutton 2020-12-23T17:01:46.138400Z

be aware there are still a few other profiles by default i think.

Ben Sless 2020-12-23T17:02:18.138600Z

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.

Ben Sless 2020-12-23T17:04:02.138800Z

From that I gather it should not be included :thinking_face:

dpsutton 2020-12-23T17:04:46.139Z

weird

dpsutton 2020-12-23T17:04:54.139200Z

what version? might be a regression

Ben Sless 2020-12-23T17:05:49.139400Z

2.9.4

Ben Sless 2020-12-23T17:07:30.139600Z

downgraded all the way to 2.9.0, found in every version hence

Ben Sless 2020-12-23T17:08:15.139800Z

even in 2.7.1

Ben Sless 2020-12-23T17:09:14.140Z

wait, no, tested badly, works well in 2.7.1

Ben Sless 2020-12-23T17:09:45.140200Z

works in 2.8.3

Ben Sless 2020-12-23T17:10:40.140400Z

aha! regression in 2.9.2