Treat :user in profile.clj as project map when outside of project. Fixes #931.

By treating the `:user` profile in `profile.clj` as the project map when one's
outside of a project, the default repositories among with any mentioned
repositories within the `:user` profile will be fetched without any issues. Also
works fine when `profile.clj` doesn't contain any `:user` profile or no
`profile.clj` exists.
This commit is contained in:
Jean Niklas L'orange 2013-01-14 10:49:32 +01:00
parent fbc1804f86
commit 1ea3c4c677
2 changed files with 3 additions and 2 deletions

View file

@ -229,7 +229,8 @@ Get the latest verison of Leiningen at http://leiningen.org or by executing
(when-not project
;; We don't use merge-profiles because we don't want to apply middleware
;; since middleware won't be ready until plugins are loaded.
(let [dummy (project/init-profiles project/defaults [:base :user])]
(let [dummy (-> (project/make (:user (user/profiles)))
(project/init-profiles [:base :user]))]
(project/load-certificates dummy)
(project/load-plugins dummy)))
(warn-chaining task-name args)

View file

@ -389,7 +389,7 @@
(when (seq (get project key))
(ensure-dynamic-classloader)
(classpath/resolve-dependencies
key (merge {:repositories default-repositories} project)
key project
:add-classpath? true))
(doseq [wagon-file (-> (.getContextClassLoader (Thread/currentThread))
(.getResources "leiningen/wagons.clj")