Permalink
Browse files

Merge pull request #737 from jeremyheiler/master

:plugin-repositories for #717
  • Loading branch information...
2 parents 314f27e + c9a89f2 commit cb134380a2b13916f43f54abf558d3fa7c911712 @technomancy committed Aug 18, 2012
Showing with 13 additions and 1 deletion.
  1. +9 −1 leiningen-core/src/leiningen/core/project.clj
  2. +4 −0 sample.project.clj
@@ -237,11 +237,19 @@
(when-not (pomegranate/modifiable-classloader? cl)
(.setContextClassLoader thread (DynamicClassLoader. cl)))))
+(defn- merge-plugin-repositories [project]
+ (if-let [pr (:plugin-repositories project)]
+ (if (:omit-default-repositories project)
+ (assoc project :repositories pr)
+ (update-in project [:repositories] merge pr))
+ project))
+
(defn load-plugins
([project key]
(when (seq (project key))
(ensure-dynamic-classloader)
- (classpath/resolve-dependencies key project :add-classpath? true))
+ (classpath/resolve-dependencies key (merge-plugin-repositories project)
+ :add-classpath? true))
(doseq [wagon-file (-> (.getContextClassLoader (Thread/currentThread))
(.getResources "leiningen/wagons.clj")
(enumeration-seq))
View
@@ -173,6 +173,10 @@
;; enironment variable to be used based on
;; the key; in this case LEIN_PASSWORD.
:username "milgrim" :password :env}}
+ ;; These repositories will be included with :repositories when loading plugins.
+ ;; This would normally be set in a profile for non-public repositories.
+ ;; All the options are the same as in the :repositories map.
+ :plugin-repositories {"internal-plugin-repo" "http://example.org/repo"}
;; You can set :update and :checksum policies here to have them
;; apply for all :repositories. Usually you will not set :update
;; directly but apply the "update" profile instead.

0 comments on commit cb13438

Please sign in to comment.