Closed lverns closed 5 months ago
Sorry, I'm unable to reproduce this problem with the steps given. Is it possible you have a plugin installed in your user.clj
which is triggering this?
I believe that I've disabled all plugins
$ ls ~/.lein/
profiles.clj.bak repl-history self-installs
Is there anywhere else they could be getting installed?
Here's the repo I'm working with in case there's something that could cause our templates to be different: https://github.com/lverns/repro-lein-2808
Aha; I see now, I was running lein new foo
instead of lein new app foo
which meant that there was no :aot :all
in the project.clj
.
The core of this issue is that because of the AOT settings, the project is first compiled as-is, then the profile settings are applied, then the jar/uberjar is created. So the tests are still excluded from the artifact, but they are present during the AOT phase. We'll have to see if we can get the profile merged earlier on in the process to fix this.
I think 6e17ebb fixes this.
Describe the bug
test-paths
are included on classpath when building uberjar. I can see this by using the following reproduction steps, or by looking at the actualjava
command that lein creates to see that it includestest
when building an uberjarTo Reproduce Steps to reproduce the behavior:
lein new app bugrepo
test/user.clj
withecho "(ns user)" > test/user.clj
andecho '(println "evaluating test/user.clj")' >> test/user.clj
lein with-profile -user,-dev,-test,+uberjar uberjar
or justlein uberjar
Actual behavior
test/user.clj
is evaluated while building the uberjar, as shown in the outputExpected behavior I would expect that
test/
would not be on the classpath when building the jarEnvironment