这是我折腾几天搞得东西,这是我的project.clj:
(defproject db "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[korma "0.3.0-RC5"]
[org.clojure/java.jdbc "0.2.2"]
[mysql/mysql-connector-java "5.1.6"]
[org.clojure/clojure-contrib "1.2.0"]
[com.novemberain/monger "3.1.0"]
]
:repositories [["central" "http://maven.aliyun.com/nexus/content/groups/public"]
["clojars" "https://mirrors.tuna.tsinghua.edu.cn/clojars/"]]
:main db.core)
(require 'cemerick.pomegranate.aether)
(cemerick.pomegranate.aether/register-wagon-factory!
"http" #(org.apache.maven.wagon.providers.http.HttpWagon.))
重点在:repositories和defproject外面那行代码,然后一个lein deps搞定依赖
另外如果有像我一样用linux的小伙伴,在用clojure调用jdbc的时候,记得sudo apt install libmysql-java