Fork me on GitHub
#leiningen
<
2018-02-05
>
grzm05:02:38

How do I get something to be added to my lein classpath by default, even when I’m not in a project directory?

grzm05:02:32

I’m testing using lein run -m clojure.main -e '(System/getProperty "java.class.path")'. I’ve tried putting things in .lein/profile.clj {:user {:dependencies ,,,}} to no avail.

grzm05:02:25

Tried :plugins too, for that matter.

mikerod13:02:13

@grzm it should be .lein/profiles.clj (plural) is that your issue?

grzm15:02:55

@mikerod thank you! thank you! thank you!

greglook16:02:28

I like separating them into the profiles subdirectory, so ~/.lein/profiles/user.clj for most customizations, then I can write a ~/.lein/profiles/system.clj file that varies per-machine (e.g. different plugin configs for linux vs osx, home vs work, etc)

grzm17:02:55

@greg316 Cool. Didn’t know that was an option! In the past I’ve tended to keep everything in project.clj so I can see everything in one place. It’s good to hear how other people handle this. Cheers!

greglook18:02:47

Another tip: you can add a profiles.clj in the project directory itself to provide local profiles that you don’t want to check into version control. I often wind up with something like this:

{:local ^:repl
 {:env {:my-env-1 "override value"
        :my-env-2 "value 2"
        ,,,}}}