`lein new midje myproject` using old midje and clojure versions - clojure

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.

Related

Leiningen not working MacOs Mojave due to Caused by: java.io.FileNotFoundException: Could not locate clojure/tools/nrepl/server__init.class

I am on Mojave and can't get leiningen to work.
I was using java 8, and then tried upgrading to 11 to no avail. Currently using:
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (buildb11.0.7+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
I have tried copying lein to my /usr/local/bin and brew install but in both cases I get the error:
Caused by: java.io.FileNotFoundException: Could not locate clojure/tools/nrepl/server__init.class, clojure/tools/nrepl/server.clj or clojure/tools/nrepl/server.cljc on classpath.
I had a similiar problem recently on macOS Mojave (10.14.6). The following command did the trick for me:
rm -rf .lein
However, before you run this line, please make sure that...
... you are in your home directory.
... .lein is a directory associated with your leiningen installation and nothing else!
... that you have a backup of any config files, custom packages, etc. that are associated with your leiningen installation.
Once you hit enter the .lein directory will be deleted. The directory will be rebuild when you start the repl via leinigen lein repl.

Hi, how to use `clojars` repo in Clojure 1.9.0 `clj` command's `deps.edn` file?

how to use clojars repo in Clojure 1.9.0 clj command's deps.edn file, just like the mvn repo:
{:deps
{clj-time {:mvn/version "0.14.2"}}}
I've tried the following but failed:
{:deps
{some/clojars-repo {:clojars/version "1.0.0"}}}
Just change clojars to mvn and the mvn works for clojars also.
{:deps
{some/clojars-repo {:mvn/version "1.0.0"}}}

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

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

how to start lein with an existing clojure jar

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.

lein bootstrap: stable release of leiningen

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.