Started playing with Clojure yesterday. I can't get around how the module system works:
- I have installed cursive
- I have created a project following the leiningen template
- I have two clojure files under
/src/clojure_first_steps
core.clj
(ns clojure-first-steps.core)
(:require [clojure-first-steps.utils :refer :all])
(defn run-other-foo
(foo-2 ["hello"]))
utils.clj
(ns clojure-first-steps.utils)
(defn foo-2 [x] (x))
although 'lein compile' runs without probs, 'lein test' fails to compile on
(:require [clojure-first-steps.utils :refer :all]), the test being:
(ns clojure-first-steps.core-test
(:require [clojure.test :refer :all]
[clojure-first-steps.core :refer :all]))
(deftest a-test
(testing "I can access dependecies from another module"
(is (= "hello" (run-other-foo)))))
The error message is java.lang.ClassNotFoundException: clojure-first-steps.utils
EDIT: Project tree
.
├── CHANGELOG.md
├── clojure_first_steps.iml
├── doc
│ └── intro.md
├── LICENSE
├── project.clj
├── README.md
├── resources
├── src
│ ├── clojure_first_steps
│ │ ├── core.clj
│ │ └── utils.clj
├── target
│ ├── classes
│ │ └── META-INF
│ │ └── maven
│ │ └── clojure_first_steps
│ │ └── clojure_first_steps
│ │ └── pom.properties
│ ├── repl-port
│ └── stale
│ └── leiningen.core.classpath.extract-native-dependencies
└── test
├── clojure_first_steps
│ └── core_test.clj
tree .in your project directory? - Piotrek Bzdyl