Skip to content
Browse files

Add a workaround for bug in Leiningen 1.6.2.

  • Loading branch information...
1 parent 4ee5b7d commit 3354565652b3e183a9d7d1b4014f4c566531b87d @brentonashworth brentonashworth committed Feb 3, 2012
Showing with 32 additions and 4 deletions.
  1. +32 −4 src/leiningen/bootstrap.clj
36 src/leiningen/bootstrap.clj
@@ -1,10 +1,38 @@
(ns leiningen.bootstrap
"Bootstrap the project by running lein deps and lein git-deps."
- (:require leiningen.deps
- leiningen.git-deps))
+ (:use [leiningen.git-deps :only [git-deps]]
+ [leiningen.core :only [default-repos]]
+ [leiningen.deps :only [deps]]
+ [leiningen.util.maven :only [container make-remote-artifact
+ make-remote-repo make-local-repo]])
+ (:import (org.apache.maven.artifact.resolver ArtifactResolver)))
+;; There is a bug in Leiningen 1.6.2 which requires that you have
+;; Clojure 1.2.1 in the local maven repository when you are working on a
+;; Clojure 1.3 project. If the first project that someone works on
+;; with Leiningen is a Clojure 1.3 based project then they will
+;; encounter this problem.
+;; A lot of people have run into this with ClojureScript One so we
+;; have added a workaround.
+;; Leiningen includes an `install` task which, for some unknown reason,
+;; takes a long time to run. Below, we have extracted just the part
+;; of that task that we need to get a dependency from a maven repository.
+(defn- standalone-download
+ "Download a dependency from a maven repository."
+ [name group version]
+ (.resolveAlways (.lookup container ArtifactResolver/ROLE)
+ (make-remote-artifact name group version)
+ (map make-remote-repo default-repos)
+ (make-local-repo)))
(defn bootstrap
"Bootstrap the project by running lein deps and lein git-deps."
- (leiningen.deps/deps project)
- (leiningen.git-deps/git-deps project))
+ ;; Workarond for Leiningen 1.6.2 bug. Ensure that we have Clojure 1.2.1 in
+ ;; the local maven repository.
+ (standalone-download "clojure" "org.clojure" "1.2.1")
+ (git-deps project)
+ (deps project))

0 comments on commit 3354565

Please sign in to comment.
Something went wrong with that request. Please try again.