Permalink
Browse files
Allow for plugin specific repositories with :plugin-repositories.
- Loading branch information...
Showing
with
13 additions
and
1 deletion.
-
+9
−1
leiningen-core/src/leiningen/core/project.clj
-
+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))
|
|
|
|
@@ -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
c9a89f2