2013-04-09 43 views

回答

7

您可以將:repositories標籤添加到您的project.clj文件:

(defproject com.foo/bar "1.0.0-SNAPSHOT" 
    ;; ...other configuration... 
    :repositories [["java.net" "http://download.java.net/maven/2"]]) 

看看官方sample project.clj

您必須在您的settings.xml文件存儲庫配置複製,但是這是慣用的和推薦的方式與Leiningen來管理存儲庫。

Does lein2 use repositories defined in ~/.m2/settings.xml?

2

順便說一句,如果你真的想添加Maven倉庫或用戶配置文件級鏡(爲內部公司代理的信息庫,如Nexus有用的,特別是如果雷音有usual problems with corporate NTLM proxies),那麼您可以在~/.lein/profiles.clj做到這一點/ %USERPROFILE%\.lein\profiles.clj

How to configure leiningen's maven usage?

在我的情況下,在Windows上,它在我的%USERPROFILE%\.lein\profiles.clj足以把這個:mirrors地圖:

{:user 
    { 
     :java-cmd "C:\\Program Files\\Java\\jdk1.7.0_09\\bin\\java.exe" 
      :plugins [ ] 
      :mirrors { 
       #".+" "http://internal-nexus.example.com/content/groups/public-all/" 
      } 
    } 
} 

`

#".+"指定鏡像存儲庫的名稱使用匹配所有可能的名字(導致鏡像每庫)模式語法,如本Leiningen issue report 271說明。