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:
- install lein script
- run
lein self-install
- do
lein new <projectname>
to create a new project in the current dir
- go into the project dir and edit the
project.clj
file
- add [org.apache.commons\commons-lang3 "3.4"] to the :dependencies vector
- run
lein repl
to update the dependencies / get dependencies from local and start a repl of the project
Also, 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])