Profile for lein's "install" and "jar" tasks

Viewed 258

In my project.clj, I'm trying to set up some jvm-opts for when I do lein run, lein jar, lein uberjar, and lein install.

So far, only the uberjar and dev entries seem to work (I can read them via System/getProperty at runtime)

:profiles {:dev     {:jvm-opts ["-Dcompiling-utils=true"]}
           :uberjar {:jvm-opts ["-Dcompiling-utils=true"]}
           :install {:jvm-opts ["-Dcompiling-utils=true"]}}

How do I get a profile for lein install and lein jar ?

thanks

1 Answers

For a given task you can activate a profile by using the higher-order task with-profile:

lein with-profile install install
lein with-profile install jar
Related