Dependency is not added to the clojure project

0

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?

    
asked by anonymous 30.08.2017 / 21:54

1 answer

0

The problem is the incorrect package name in the core.clj file.

To resolve, replace

(:import (org.apache.commons.langr StringUtils)))

by

(:import (org.apache.commons.lang3 StringUtils)))
    
30.08.2017 / 22:01