Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check for :repository-auth when deploying. Fixes #402.

  • Loading branch information...
commit 36791e3997ecdea1c291204190b699a90a6d321a 1 parent 1c41bf0
@technomancy authored
Showing with 18 additions and 18 deletions.
  1. +16 −16 src/leiningen/deploy.clj
  2. +2 −2 todo.org
View
32 src/leiningen/deploy.clj
@@ -1,6 +1,7 @@
(ns leiningen.deploy
"Build and deploy jar to remote repository."
- (:require [cemerick.pomegranate.aether :as aether])
+ (:require [cemerick.pomegranate.aether :as aether]
+ [leiningen.core.classpath :as classpath])
(:use [leiningen.jar :only [jar]]
[leiningen.pom :only [pom snapshot?]]
[clojure.java.io :only [file]]))
@@ -13,27 +14,26 @@ versions will go to the repo named \"snapshots\" while stable versions
will go to \"releases\". You can also deploy to another repository
in :repositories by providing its name as an argument.
- :repositories {\"java.net\" \"http://download.java.net/maven/2\"
- \"snapshots\" {:url \"https://blueant.com/archiva/snapshots\"
- :username \"milgrim\" :password \"locative\"}
- \"releases\" {:url \"https://blueant.com/archiva/internal\"
- :private-key \"etc/id_dsa\"}}
+ :repositories {\"snapshots\" \"https://internal.repo/snapshots\"
+ \"releases\" \"https://internal.repo/releases\"
+ \"alternate\" \"https://other.server/repo\"}
-You can set authentication options keyed by repository name in
-~/.lein/init.clj to avoid checking sensitive information into source
-control:
+You should set authentication options keyed by repository URL in
+the :deploy profile in ~/.lein/profiles.clj to avoid checking
+sensitive information into source control:
- (def leiningen-auth {\"https://blueant.com/archiva/internal\"
- {:passphrase \"vorpalbunny\"}})
+ {:user {:plugins [...]}
+ :auth {:repository-auth {\"https://internal.repo/snapshots\"
+ {:username \"milgrim\" :password \"locative}}}}
"
([project repository-name]
(let [jarfile (jar project)
pomfile (pom project)
- repo-opts (or (get (apply hash-map (flatten (:deploy-repositories project))) repository-name)
- (get (apply hash-map (flatten (:repositories project))) repository-name))
- repo (if repo-opts
- {repository-name repo-opts}
- {"inline" repository-name})]
+ repo-opts (or ((into {} (:deploy-repositories project)) repository-name)
+ ((into {} (:repositories project)) repository-name))
+ repo (repo/add-repo-auth (if repo-opts
+ {repository-name repo-opts}
+ {"inline" {:url repository-name}}))]
(if (number? jarfile)
;; if we failed to create the jar, return the status code for exit
jarfile
View
4 todo.org
@@ -25,12 +25,12 @@ See also https://github.com/technomancy/leiningen/issues
- [X] Look for aliases in project.clj
- [X] javac (can we do this without ant?)
- [X] Get off snapshots (data.xml, reply)
- - [ ] Pass user-level repository auth settings on to pomegranate
+ - [X] Pass user-level repository auth settings on to pomegranate
- [ ] Use ordered map for :dependencies and :repositories?
- - [ ] Honor hooks declared in plugin jar metadata?
- [ ] Look for :java-cmd in project map
** Other stuff (post-preview)
- [ ] Offline mode
+ - [ ] Honor hooks declared in plugin jar metadata?
- [ ] Task-level profiles (nrepl dep comes from repl profile, etc)
Better visibility than either :default profile or associng straight in
- [ ] Investigate issues with :eval-in :classloader and bootclasspath
Please sign in to comment.
Something went wrong with that request. Please try again.