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
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
After following the instruction set on https://leiningen.org/ to install Leiningen, I have managed to download the batch file and save it within a folder located in: C:\Users\Dylan\Bin\Lein.bat.
I then ran lein.bat self-install in CMD, which created the folder .lein:
At this point the Leiningen is added. I am then able to create a new project called tictactoe using the command lein new figwheel tictactoe -- --reagent in CMD and it creates the folder fine. However, the problem arises when I try to compile the tictactoe project, see below:
When I issue the lein new figwheel tictactoe -- --reagent command, it says
Generating fresh 'lein new' figwheel project.
Change into your 'tictactoe' directory
Install npm dependencies via 'npm install'
Then run 'lein figwheel'
Did you do the npm install?
I am trying to download/install/run clojure/lein and facing some initial problems. I am using cygwin on windows-7.
After downloading the latest clojure (1.8.0), the following step works fine:
java -cp clojure-1.8.0.jar clojure.main
Now I installed lein using the following steps (thanks to stackoverflow/18711805 for help):
download lein script into ~/bin , set filetype=unix
install wget and deps (see stackoverflow/18711805)
setenv HTTP_CLIENT "wget --no-check-certificate -O"
lein self-install
Now when I run "lein repl", I find that lein has downloaded another clojure version (1.7.0) and using that.
So, how can I ask lein to use my version of clojure (ie 1.8.0) and not the 1.7.0 ? Are there any extra environment variables to be set before the lein run?
Also, where does lein install its extra downloads, and how do I clean up that area?
"lein upgrade" did the trick, I got the hint from stackoverflow/24094597. Now when I run lein again I can see 1.8.0 (not my own install, but lein has installed this new version). But since I installed lein just a few minutes ago from scratch anyway, I am not sure why it did not install the latest version in the first place.
I noted that lein new midje myproject uses clojure 1.4.0 and midje 1.5.1 instead of 1.7.0 and 1.7.0.
How can I tell lein new midje ... to use the latest versions? Here is my ? project.clj file:
(defproject myproject "0.0.1-SNAPSHOT"
:description "Cool new project to do things and stuff"
:dependencies [[org.clojure/clojure "1.4.0"]]
:profiles {:dev {:dependencies [[midje "1.5.1"]]}})
lein version
> Leiningen 2.5.1 on Java 1.7.0_55 OpenJDK 64-Bit Server VM
ls ~/.m2/repository/midje/lein-template
> resolver-status.properties
The update flag will force an update of dependency snapshots. You might try this-
lein -U new midje myproject
Running lein help will give a bit more detail-
Global Options:
-o Run a task offline.
-U Run a task after forcing update of snapshots.
-h, --help Print this help or help for a specific task.
-v, --version Print Leiningen's version.
I have just deployed a version of my Clojure application to Heroku.
I cannot open lein repl using "heroku run":
$ heroku run lein repl
Running lein repl attached to terminal... up, run.6649
Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true -Djava.rmi.server.useCodebaseOnly=true
rlwrap: Could not open master pty: Exec format error
This has worked previously.
Whenever I try to run lein bootstrap in the leiningen-core/ directory I always get the following message:
Please run "lein bootstrap" in the leiningen-core/ directory
with a stable release of Leiningen. See CONTRIBUTING.md for details.
I have the 2.2.0 script (which is a stable release). I have placed lein in my path. I am using
Linux (CentOS)
bootstrap is only necessary if you are building lein from source. If you downloaded a stable release, it Just Works. So you can do things like lein new, lein jar, etc, with no further setup. See the excellent README for details.
Set your path correctly. For example, put the lein script in your ~/bin and then add ~/bin to your path environment variable.