我爲我公司的內部工件設置了Nexus存儲庫。回購也代理Maven的中央,Clojars,等我已指示Leiningen通過增加使用我的回購下面我~/.lein/profiles.clj
:Leiningen忽略:某些依賴關係的鏡像
{:user {:mirrors {#".+" {:name "Nuday"
:url "http://nexus.example.com:8081/nexus/content/groups/public"}}}}
然而,在我project.clj
列出了一些依賴,Leiningen似乎忽略我:mirrors
設置。下面是一個項目一個示範具有以下依存關係:
(defproject com.example.infrastructure/foo "2.1.0"
:dependencies [[org.clojure/data.json "0.2.4"]
[org.clojure/tools.namespace "0.1.1"]])
現在刪除一些緩存的依賴和編譯:
: [email protected]; rm -rf ~/.m2/repository/org/clojure/data.json/
: [email protected]; rm -rf ~/.m2/repository/org/clojure/tools.namespace/
: [email protected]; 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
正如你所看到的,org.clojure/tools.namespace
從我的私人「Nuday」回購檢索,而org.clojure/data.json
直接進入「中央」回購。我用Wireshark驗證過我的回購沒有被查詢org.clojure/data.json
依賴關係。
有沒有人有線索可能會發生在這裏?
Wireshark甚至不向我的回購顯示HTTP查詢,所以這看起來不像是Nexus問題。我也在Java Maven項目中使用相同的回購,並且他們在解決代理依賴問題上沒有問題。 –
好的。由於您在Wireshark診斷中只提及'org.clojure/data/json',因此我假設您已經觀察到以前的工件被查詢。 –