I'm learning Clojure and created a simple spellchecker project. In this project, I would like to use the StringUtils class from Apache Commons, so I added the following lines of code to import it into my project.
; arquivo core.clj -- contém o método main
(ns spellchecker.core
(:require [clojure.string :as str])
(:import (org.apache.commons.langr StringUtils)))
; arquivo project.clj -- contém as dependências
(defproject spellchecker "0.1.0-SNAPSHOT"
:description "simple spell checker"
: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"]
[org.apache.commons/commons-lang3 "3.3.2"]]
:main ^:skip-aot spellchecker.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
However, when I execute the command lein run
within the directory of my project. I get the error: CompilerException java.lang.ClassNotFoundException: org.apache.commons.langr.StringUtils, compiling:(/home/leonardo/clojure-learning/spellchecker/src/spellchecker/core.clj:1:1)
which basically says that the dependency has not been downloaded. How can I download the dependencies before or when I run the project?