2012-03-05 109 views
8

我知道可以使用lein ring war創建戰爭文件,但它似乎仍包含碼頭依賴關係。有沒有辦法在構建戰爭(並在tomcat上部署)時排除碼頭依賴關係?ring/compojure without jetty

如果我根本不能做這件事,或者它只是打包成戰爭但從未實際使用過的額外的罐子/類文件?

回答

5

Leinigen支持:排除依賴項。

(defproject my-project "1.0.0" 
    :dependencies [[org.clojure/clojure "1.2.0"] 
        [org.clojure/clojure-contrib "1.2.0"]] 
    :dev-dependencies [[autodoc "0.7.1" :exclusions [org.apache.ant/ant]]]) 

有關詳細信息,請參見here

通常問題出在哪裏依賴來自。在maven中,你可以這樣做:

mvn dependency:tree 

獲得依賴關係樹的有用ASCII藝術表示。

一種選擇是使用

lein pom 

然後乳寧行家了,要爲您的項目的pom.xml。

+3

Leiningen現在有能力用'lein deps:tree'直接打印依賴樹。沒有更多的Maven poms! – 2013-01-13 19:09:38