For example:
If I specific the path ~/.m2/repository
When I import some dependencies in cmd line like follow then it can find the jar location by my maven pom file.
[yf@local]java -cp clojure-1.8.0.jar clojure.main
Clojure 1.8.0
user=>
user=> (:import org.apache.commons.lang StringUtils)
Clojure itself does not do any dependency management at all. For that you need Leiningen, which is clojure's build and dependency management tool, which can work with Maven repo's.
Steps:
lein self-installlein new <projectname>to create a new project in the current dirproject.cljfilelein replto update the dependencies / get dependencies from local and start a repl of the projectAlso, the
(:import [org.apache.commons.lang StringUtils])can only be used within the(ns )block. Used outside of the ns block you should do a(import [org.apache.commons.lang StringUtils])