Permalink
Browse files

Upgrade to maven-ant-tasks 2.1.3, explicitly add disabled "central" r…

…epository when :omit-default-repositories is true. Fixes #211.
  • Loading branch information...
1 parent 6e0454f commit 2c324b300341b8ea1c99250ee36164b380272265 @cemerick cemerick committed Aug 25, 2011
Showing with 18 additions and 7 deletions.
  1. +1 −1 project.clj
  2. +3 −3 sample.project.clj
  3. +13 −2 src/leiningen/core.clj
  4. +1 −1 todo.org
View
@@ -12,6 +12,6 @@
[lancet "1.0.1"]
[jline "0.9.94" :exclusions [junit]]
[robert/hooke "1.1.2"]
- [org.apache.maven/maven-ant-tasks "2.0.10" :exclusions [ant]]]
+ [org.apache.maven/maven-ant-tasks "2.1.3" :exclusions [ant]]]
:disable-implicit-clean true
:eval-in-leiningen true)
View
@@ -116,9 +116,9 @@
:repl-retry-limit 1000
;; Emit warnings on all reflection calls.
:warn-on-reflection true
- ;; Set this in order to only use the :repositories you list below. Note that
- ;; a bug in maven-ant-tasks prevents Leiningen from excluding Maven Central,
- ;; so in effect this simply omits Clojars.
+ ;; Set this in order to only use the :repositories you list below. Note that,
+ ;; if any artifacts are not found, Maven Central will still be reported to
+ ;; have been checked, even though it was not.
:omit-default-repositories true
:repositories {"java.net" "http://download.java.net/maven/2"
"sonatype"
@@ -128,6 +128,14 @@ Warning: alpha; subject to change."
;; TODO: possibly separate releases/snapshots in 2.0.
"clojars" {:url "http://clojars.org/repo/"}})
+;; you can't remove or omit "central", you can only disable it;
+;; maven/maven-ant-tasks adds it implicitly, and will continue to
+;; report it in the list of checked repositories, even though it's
+;; not been consulted. The URL will hopefully be clear enough to users.
+(def disabled-central-repo {"central" {:url "http://disabled-central"
+ :snapshots false
+ :releases false}})
+
(defn- init-settings [id settings]
(cond (string? settings) {:url settings}
;; infer snapshots/release policy from repository id
@@ -140,8 +148,11 @@ Warning: alpha; subject to change."
[project]
(merge (when-not (:omit-default-repositories project)
default-repos)
- (into {} (for [[id settings] (:repositories project)]
- [id (init-settings id settings)]))))
+ (let [repositories (merge (and (:omit-default-repositories project)
+ disabled-central-repo)
+ (:repositories project))]
+ (into {} (for [[id settings] repositories]
+ [id (init-settings id settings)])))))
(defn exit
"Call System/exit. Defined as a function so that rebinding is possible."
View
@@ -16,7 +16,6 @@ See also https://github.com/technomancy/leiningen/issues
Try a custom classloader approach?
- Use Aether instead of maven-ant-tasks?
http://www.sonatype.com/people/2010/08/introducing-aether/
- Could also allow us to fix :omit-default-repositories wrt central
- classifiers for specifying what clojure version to use?
As more versions of Clojure start to exist, libraries may want to
publish different branches that target different versions of
@@ -29,6 +28,7 @@ See also https://github.com/technomancy/leiningen/issues
lein-clojars task doesn't support DSA keys
* For 1.6.2
- [X] resources with eval-in-leiningen (#248)
+ - [X] fix :omit-default-repositories wrt central (#211)
- [ ] signed deps for plugins (#247)
- [ ] investigate interactive failures with 1.3 (#234)
- [ ] remove bashisms (#246)

0 comments on commit 2c324b3

Please sign in to comment.