似乎无法导入test.generative的名称空间

时间:2013-07-28 01:15:16

标签: clojure leiningen

所以,我在test.generative中需要一些命名空间时遇到了麻烦。我有以下project.clj:

(defproject gen "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                             [org.clojure/test.generative "0.1.4"]])

然后从终端:

stephen@stephen-ubuntu:~/Work/gen$ rm -r ../../.m2/
stephen@stephen-ubuntu:~/Work/gen$ lein deps
Retrieving lein-pprint/lein-pprint/1.1.1/lein-pprint-1.1.1.pom from clojars
Retrieving lein-marginalia/lein-marginalia/0.7.1/lein-marginalia-0.7.1.pom from clojars
Retrieving marginalia/marginalia/0.7.1/marginalia-0.7.1.pom from clojars
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.pom from central
Retrieving org/sonatype/oss/oss-parent/5/oss-parent-5.pom from central
Retrieving org/clojure/tools.namespace/0.1.1/tools.namespace-0.1.1.pom from central
Retrieving org/clojure/pom.contrib/0.0.20/pom.contrib-0.0.20.pom from central
Retrieving org/clojure/java.classpath/0.1.1/java.classpath-0.1.1.pom from central
Retrieving org/clojure/clojure/1.3.0-alpha5/clojure-1.3.0-alpha5.pom from central
Retrieving org/clojure/tools.cli/0.2.1/tools.cli-0.2.1.pom from central
Retrieving org/clojure/pom.contrib/0.0.25/pom.contrib-0.0.25.pom from central
Retrieving org/clojure/clojure/1.3.0/clojure-1.3.0.pom from central
Retrieving org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.pom from central
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.jar from central
Retrieving org/clojure/tools.namespace/0.1.1/tools.namespace-0.1.1.jar from central
Retrieving org/clojure/java.classpath/0.1.1/java.classpath-0.1.1.jar from central
Retrieving org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.jar from central
Retrieving org/clojure/tools.cli/0.2.1/tools.cli-0.2.1.jar from central
Retrieving lein-marginalia/lein-marginalia/0.7.1/lein-marginalia-0.7.1.jar from clojars
Retrieving lein-pprint/lein-pprint/1.1.1/lein-pprint-1.1.1.jar from clojars
Retrieving marginalia/marginalia/0.7.1/marginalia-0.7.1.jar from clojars
Retrieving org/clojure/clojure/1.5.1/clojure-1.5.1.pom from central
Retrieving org/clojure/test.generative/0.1.4/test.generative-0.1.4.pom from central
Retrieving org/clojure/pom.contrib/0.0.23/pom.contrib-0.0.23.pom from central
Retrieving org/clojure/clojure/1.3.0-beta1/clojure-1.3.0-beta1.pom from central
Retrieving org/clojure/tools.nrepl/0.2.3/tools.nrepl-0.2.3.pom from central
Retrieving org/clojure/pom.contrib/0.1.2/pom.contrib-0.1.2.pom from central
Retrieving org/sonatype/oss/oss-parent/7/oss-parent-7.pom from central
Retrieving org/clojure/clojure/1.2.0/clojure-1.2.0.pom from central
Retrieving clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.pom from clojars
Retrieving org/clojure/clojure/1.5.1/clojure-1.5.1.jar from central
Retrieving org/clojure/tools.nrepl/0.2.3/tools.nrepl-0.2.3.jar from central
Retrieving org/clojure/test.generative/0.1.4/test.generative-0.1.4.jar from central
Retrieving clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.jar from clojars

其次,

stephen@stephen-ubuntu:~/Work/gen$ lein repl
nREPL server started on port 36954
REPL-y 0.2.0
Clojure 1.5.1
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)

user=> (require '[clojure.test.generative.runner :as runner])

FileNotFoundException Could not locate clojure/test/generative/runner__init.class or clojure/test/generative/runner.clj on classpath:   clojure.lang.RT.load (RT.java:443)
user=> (require '[clojure.test.generative :as gen])
nil

似乎我可以要求clojure.test.generative而不是clojure.test.generative.runner。我做错了什么?

1 个答案:

答案 0 :(得分:1)

0.1.4 test.generative mvn jar似乎存在问题。

我使用了project.clj的副本并将依赖关系切换为0.1.5,问题得到了解决。