Fork me on GitHub
#leiningen
<
2021-01-28
>
Shantanu Kumar13:01:31

When I put :local-repo "local-m2" under a :local profile, even when I say lein with-profile local do clean, test it still downloads the plugin dependencies in ~/.m2 instead of ./local-m2. Can anybody suggest how to download all plugins in the specified repo?

Shantanu Kumar13:01:15

Or maybe if there’s a way to add :local-repo "local-m2" to project map only if an ENV var is set?

Shantanu Kumar14:01:08

OK, I fixed it by putting :local-repo ~(System/getenv "M2") at the top-level under defproject.

mikerod18:01:55

I think I’ve done something similar to that in the past

mikerod18:01:43

I’d have to look up exact details. But think it needs to be determined at top level since during profile merging it’s too late.

mikerod19:01:55

Confirmed. I used env var via top-level key with ~ eval like you had above

mikerod19:01:12

And ensure it defaults to standard when env variable not set.

mikerod19:01:23

But perhaps yours always is.