5

After installing leiningen with this script https://raw.github.com/technomancy/leiningen/preview/bin/lein , I can use the repl by typing lein repl, so I think the clojure has already been installed by leiningen.

Do I need to download the JAR of the clojure again from the offical site?

If there's no need to do this, where's the JAR file of clojure that leiningten depends on?

Hanfei Sun
  • 45,281
  • 39
  • 129
  • 237

3 Answers3

6

leiningen downloads dependencies from maven repositories and stores them (by default) in

${HOME}/.m2/repository

leiningen stores it's own jar in

${HOME}/.lein/self-installs

the default maven repositories searched by leiningen are

sw1nn
  • 7,278
  • 1
  • 26
  • 36
  • You mention "by default" for where leiningen stores dependencies. Is there a way to customize that location? I don't want these in my local maven. – Depressio May 30 '14 at 01:05
  • Nix that question. You can specify the `:local-build` in project.clj. – Depressio May 30 '14 at 01:31
5

What I've found with lein is installing it and then depending on a specific version of Clojure causes that version to be fetched, and the .jar file winds up in the maven repository.

(defproject repl-test "0.0.1-SNAPSHOT"
  :description "TODO: add summary of your project"
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [clojure-csv/clojure-csv "1.3.2"]
                 [org.clojure/tools.cli "0.1.0"]
                 [util "1.0.2-SNAPSHOT"]
                 [clj-http "0.1.3"]]
   :aot [repl-test.core]
   :main repl-test.core)

I'm not sure how Clojure is packaged with lein, but I do know from watching a lein build that it causes the version of Clojure in :dependencies to be fetched (downloaded).

lein is so good, that I actually un-installed default Clojure, because having lein is less of a pain when Clojure goes into a new revision.

octopusgrabbus
  • 10,555
  • 15
  • 68
  • 131
  • Thanks, but I have another question following this: http://stackoverflow.com/questions/12064339/how-to-run-clojure-as-a-script-using-leningen – Hanfei Sun Aug 21 '12 at 23:11
0

Leiningen is a tool that manages Clojure (and Java) libraries for you --- including Clojure itself (which is just another Java library (a jar)).

You don't need to manually download any jars when using lein.

Leiningen consists of two parts: the lein script and an implementation jar that it keeps in ~/.lein --- but you don't need to worry about that jar; the lein script takes care of getting it for you.

I wrote a Brief Beginner's Guide which you might find useful.

uvtc
  • 710
  • 3
  • 8