Hey, I am having a problem with lein
When I run lein test
it works normally, but when I run lein with-profile ci-tests
, I get the error
Syntax error (IllegalAccessError) compiling at (clojure/tools/reader/edn.clj:1:1).
reader-error does not exist
This is the profile config:
:test {:resource-paths ["test/resources"]
:dependencies [[clj-http "3.10.0"]]}
:ci-tests {:test-paths ["ci-tests/resources"]
:dependencies [[clj-http "3.10.0"]]}
@aoellerer do you have any other profiles?
:dev {:resource-paths ["dev/resources"]
:source-paths ["dev"]
:dependencies [[org.clojure/tools.namespace "0.3.1"]
[clj-http "3.10.0"]]}}
Ok. So try lein with-profile +ci-tests
ie added a +
Also I’m pretty sure the :test
profile is always going to be active during the test
task. So if you need stuff to not be included during ci-tests
then they should go to a non-special profile.
What do you mean? That I can take the clj-http
dependency out of the dependecies?
Ok, I now get a similar error when running lein uberjar
It seems as if you have to include [org.clojure/tools.reader "1.3.2"]
into the dependencies
@aoellerer you are transitively getting that dependency (`org.clojure/tools.reader`) from org.clojure/tools.namespace
most likely
if you have an explicit dependency on it, it’s correct for you to declare it directly instead of rely on org.clojure/tools.namespace
to bring it for you
lein ubejar
will not include default lein
profiles - intentionally it leaves out all profiles not specified except the “special” profile name uberjar
this is because the default profiles have things that shouldn’t be in your “production deployed artifacts”
and when you use with-profile
you take explicit control of what profiles are added - so again, the default lein
profiles do not get added
if you use with-profile +my-profile
that means to include my-profile
plus any other default profiles already active
which worked in your ci-tests
case, since presumably you were running the test
task
lein uberjar
and lein jar
(which also affects lein install
)are a bit more aggressive though - they will remove default profiles and you have to instead use :leaky
metadata - but won’t get into that - not typically needed
See docs, such as https://github.com/technomancy/leiningen/blob/2.9.1/doc/PROFILES.md#default-profiles
Thank you!
no problem, hopefully it starts to make sense for you w/this