I have a Nexus repository set up for my company's internal artifacts. The repo also proxies Maven Central, Clojars, etc. I have instructed Leiningen to use my repo by adding the following to my ~/.lein/profiles.clj:
{:user {:mirrors {#".+" {:name "Nuday"
:url "http://nexus.example.com:8081/nexus/content/groups/public"}}}}
However, for some dependencies listed in my project.clj, Leiningen seems to ignore my :mirrors setting. Here's a demonstration for a project with the following dependencies:
(defproject com.example.infrastructure/foo "2.1.0"
:dependencies [[org.clojure/data.json "0.2.4"]
[org.clojure/tools.namespace "0.1.1"]])
And now to remove some cached dependencies and compile:
: jmglov@alhana; rm -rf ~/.m2/repository/org/clojure/data.json/
: jmglov@alhana; rm -rf ~/.m2/repository/org/clojure/tools.namespace/
: jmglov@alhana; lein jar
Retrieving org/clojure/tools.namespace/0.1.1/tools.namespace-0.1.1.pom from Nuday
Retrieving org/clojure/tools.namespace/0.2.4/tools.namespace-0.2.4.pom from Nuday
Retrieving org/clojure/tools.namespace/0.2.1/tools.namespace-0.2.1.pom from Nuday
Retrieving org/clojure/tools.namespace/0.2.4/tools.namespace-0.2.4.jar from Nuday
Retrieving org/clojure/tools.namespace/0.1.1/tools.namespace-0.1.1.jar from central
Retrieving org/clojure/data.json/0.2.4/data.json-0.2.4.pom from central
Retrieving org/clojure/data.json/0.2.4/data.json-0.2.4.jar from central
Created foo-2.1.0.jar
As you can see, org.clojure/tools.namespace is retrieved from my private "Nuday" repo, whereas org.clojure/data.json goes directly to the "central" repo. I have verified with Wireshark that my repo is not being queried for the org.clojure/data.json dependency at all.
Does anyone have a clue what might be going on here?