2016-08-15 42 views
0

Clojure的新手,並一直在使用Leiningen來管理我的Clojure項目。Clojure Couchbase相關性問題

我想連接到一個Couchbase鬥所以我包括:

[couchbase-clj "0.2.0"] 
在我project.clj

在GitHub的回購https://github.com/otabat/couchbase-clj

我也跑指出:

lein deps 

要安裝我的依賴項,雖然Leiningen指南指出如果我不這樣,它會自動下載依賴項 。 https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#dependencies

所以我要下面的代碼在我core.clj

(ns first-app.core 
(:gen-class :main true)) 

(:require [couchbase-clj.client :as c])) 

(c/defclient client {:bucket "subgate" 
       :uris ["http://127.0.0.1:8091"]}) 

(defn -main 
    "I don't do a whole lot ... yet." 
    [& args] 
    (println "Hello, World! ")) 

但是當我運行:

lein run 

我得到的錯誤:

Exception in thread "main" java.lang.ClassNotFoundException: couchbase-clj.client, compiling:(first_app/core.clj:4:3) 

這裏是我的依賴關係樹:

[cider/cider-nrepl "0.8.1"] 
[cljs-tooling "0.1.3" :exclusions [[org.clojure/clojure]]] 
[compliment "0.2.0" :exclusions [[org.clojure/clojure]]] 
[org.clojure/java.classpath "0.2.0" :exclusions [[org.clojure/clojure]]] 
[org.clojure/tools.namespace "0.2.5" :exclusions [[org.clojure/clojure]]] 
[org.clojure/tools.trace "0.7.8" :exclusions [[org.clojure/clojure]]] 
[org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]] 
[clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]] 
[couchbase-clj "0.2.0"] 
[com.couchbase.client/couchbase-client "1.3.2"] 
    [commons-codec "1.5"] 
    [io.netty/netty "3.5.5.Final"] 
    [net.spy/spymemcached "2.10.5"] 
    [org.apache.httpcomponents/httpcore-nio "4.3"] 
    [org.apache.httpcomponents/httpcore "4.3"] 
    [org.codehaus.jettison/jettison "1.1"] 
    [stax/stax-api "1.0.1"] 
[org.clojure/data.json "0.2.4"] 
[org.clojure/clojure "1.8.0"] 
[org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]] 

歡迎任何提示,因爲我是Clojure的新手! 在此先感謝。

回答

0

必須在ns定界符之前包含我的要求。

(ns first-app.core 
    (:gen-class :main true) 
    (:require [couchbase-clj.client :as c])) 

特別感謝moxaj Reddit上