Skip to content

Commit

Permalink
Plumb through mirror support to pomegranate. Fixes #271.
Browse files Browse the repository at this point in the history
Won't actually be visible until pomegranate is bumped to 0.0.13.
  • Loading branch information
technomancy committed Jun 25, 2012
1 parent 13608e8 commit a32abdf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 3 additions & 2 deletions leiningen-core/src/leiningen/core/classpath.clj
Expand Up @@ -111,8 +111,8 @@
(last (take-while identity (iterate (memfn getCause) e)))) (last (take-while identity (iterate (memfn getCause) e))))


(defn- get-dependencies (defn- get-dependencies
[dependencies-key {:keys [repositories local-repo offline? update checksum] [dependencies-key {:keys [repositories local-repo offline? update
:as project} checksum mirrors] :as project}
& {:keys [add-classpath?]}] & {:keys [add-classpath?]}]
{:pre [(every? vector? (project dependencies-key))]} {:pre [(every? vector? (project dependencies-key))]}
(try (try
Expand All @@ -125,6 +125,7 @@
(map add-repo-auth) (map add-repo-auth)
(map (partial update-policies update checksum))) (map (partial update-policies update checksum)))
:coordinates (project dependencies-key) :coordinates (project dependencies-key)
:mirrors mirrors
:transfer-listener :stdout :transfer-listener :stdout
:proxy (get-proxy-settings)) :proxy (get-proxy-settings))
(catch Exception e (catch Exception e
Expand Down
8 changes: 8 additions & 0 deletions sample.project.clj
Expand Up @@ -161,6 +161,14 @@
;; dependency resolution. ;; dependency resolution.
:deploy-repositories {"releases" "http://blueant.com/archiva/internal/releases" :deploy-repositories {"releases" "http://blueant.com/archiva/internal/releases"
"snapshots" "http://blueant.com/archiva/internal/snapshots"} "snapshots" "http://blueant.com/archiva/internal/snapshots"}
;; Fetch dependencies from mirrors. Mirrors override repositories when the key
;; in the :mirrors map matches either the name or URL of a specified
;; repository. All settings supported in :repositories may be set here too.
:mirrors {"central" {:name "Ibiblio"
:url "http://mirrors.ibiblio.org/pub/mirrors/maven2"}
#"clojars" {:name "Internal nexus"
:url "http://mvn.local/nexus/releases"
:repo-manager true}}
;; Prevent Leiningen from checking the network for dependencies. ;; Prevent Leiningen from checking the network for dependencies.
;; This wouldn't normally be set in project.clj; it would come from a profile. ;; This wouldn't normally be set in project.clj; it would come from a profile.
:offline? true :offline? true
Expand Down
1 change: 1 addition & 0 deletions src/leiningen/deps.clj
Expand Up @@ -46,6 +46,7 @@
dep (into (vec (take 2 dep)) (apply concat dep-map))] dep (into (vec (take 2 dep)) (apply concat dep-map))]
(try (->> (aether/resolve-dependencies (try (->> (aether/resolve-dependencies
:repositories (:repositories project) :repositories (:repositories project)
:mirrors (:mirrors project)
:coordinates [dep]) :coordinates [dep])
(aether/dependency-files) (aether/dependency-files)
(filter #(.endsWith (.getName %) ".asc")) (filter #(.endsWith (.getName %) ".asc"))
Expand Down
7 changes: 4 additions & 3 deletions todo.org
Expand Up @@ -14,10 +14,11 @@ See also https://github.com/technomancy/leiningen/issues
- [X] Address gpg agent issues (#615) - [X] Address gpg agent issues (#615)
- [X] Stale directory clutter (#589) - [X] Stale directory clutter (#589)
- [X] Fix de-dupe with :classifier/:extension (#645) - [X] Fix de-dupe with :classifier/:extension (#645)
- [X] Check project for :scm (#640)
- [X] Mirror support (#271)
- [ ] Allow jars to be signed, document in deploying guide. (#519) - [ ] Allow jars to be signed, document in deploying guide. (#519)
- [ ] Mirror support (#271) - [ ] Fix javac to abort on failure (#658)
- [ ] Warn when <scm> isn't in pom (#641) - [ ] Only look up repo credentials when necessary (#657)
- [ ] Check project for :scm (#640)
** preview4 ** preview4
- [X] Don't re-extract native deps (#535) - [X] Don't re-extract native deps (#535)
- [X] Make offline profile use dev profile (#514) (LHF) - [X] Make offline profile use dev profile (#514) (LHF)
Expand Down

0 comments on commit a32abdf

Please sign in to comment.