From 338dbbc36ca91b21b9898e537efb618420e382bd Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Fri, 18 Feb 2011 20:43:17 -0800 Subject: [PATCH] Key leiningen-auth by URL instead of repo name. --- src/leiningen/deploy.clj | 3 ++- src/leiningen/deps.clj | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/leiningen/deploy.clj b/src/leiningen/deploy.clj index 3ec8c305..0eb295ca 100644 --- a/src/leiningen/deploy.clj +++ b/src/leiningen/deploy.clj @@ -36,7 +36,8 @@ You can set authentication options keyed by repository name in ~/.lein/init.clj to avoid checking sensitive information into source control: - (def leiningen-auth {\"releases\" {:passphrase \"vorpalbunny\"}}) + (def leiningen-auth {\"https://blueant.com/archiva/internal\" + {:passphrase \"vorpalbunny\"}}) " ([project repository-name] (doto (DeployTask.) diff --git a/src/leiningen/deps.clj b/src/leiningen/deps.clj index a96ae8ef..57a8ea06 100644 --- a/src/leiningen/deps.clj +++ b/src/leiningen/deps.clj @@ -11,9 +11,9 @@ (org.apache.maven.settings Server) (org.apache.tools.ant.util FlatFileNameMapper))) -(defn make-auth [id settings] +(defn make-auth [settings] (let [user-options (when-let [user-opts (resolve 'user/leiningen-auth)] - (get @user-opts id)) + (get @user-opts (:url settings))) {:keys [username password passphrase private-key] :as settings} (merge user-options settings) auth (Authentication.)] @@ -31,7 +31,7 @@ settings)] (.setId repo id) (.setUrl repo (:url settings)) - (when-let [auth (make-auth id settings)] + (when-let [auth (make-auth settings)] (.addAuthentication repo auth)) repo))