I've noticed that test/user.clj is being evaluated when running lein with-profile production uberjar . Is there any way to prevent that?
I'm running lein 2.10.0.
You should be able to reproduce this by creating a demo app with lein new app and creating test/user.clj with the following contents:
(ns user)
(println "Running test/user.clj")
and then lein uberjar to see the message printTry:
lein with-profile -user,-dev,-test production uberjar
and make sure "test" is not in your :source-paths, :test-paths, :resource-paths within the :production profile
$ lein with-profile -user,-dev,-test production uberjar
'production' is not a task. See 'lein help'.
Error encountered performing task 'production' with profile(s): 'base,system,provided'
Task not found
Maybe you meant
$ lein with-profile -user,-dev,-test,+production uberjar
Running test/user.clj
Compiling inthejar.core
Created /home/laverne/repos/inthejar/target/uberjar+production/inthejar-0.1.0-SNAPSHOT.jar
Created /home/laverne/repos/inthejar/target/uberjar/inthejar-0.1.0-SNAPSHOT-standalone.jar
which as you can see still printsI don't have a production profile in project.clj or in ~/.lein/profiles.clj
Yes I meant that
are you sure "test" isn't anywhere unusual within project.clj?
Another possibility being some plugin going on
yeah, I should check my plugins...
I've commented out everything in ~/.lein/profiles.clj my project.clj is just:
(defproject inthejar "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url " "}
:dependencies [[org.clojure/clojure "1.10.1"]]
:src-paths ["src"]
:main ^:skip-aot inthejar.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})
should be :source-paths :)
ha! I added that as a debugging step and was wondering why dumping additional entries in there seemed to have no effect. Anyway, removing that nonsense line didn't change the output
perhaps :source-paths ["src"] can help, I've had related experiences
also, for that project, lein with-profile -user,-dev,-test,+uberjar uberjar would be the nicest invocation
other than that I ran out of ideas 😑
Perhaps you AOTed at some point? Try lein clean / git clean -fdx
no dice. I'll open a bug report. Thanks for your help!