我收到以下错误:
#error {
:cause org.apache.commons.codec.binary.Base32
:via
[{:type clojure.lang.Compiler$CompilerException
:message java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base32, compiling:(crypto/random.clj:1:1)
:at [clojure.lang.Compiler load Compiler.java 7239]}
{:type java.lang.ClassNotFoundException
:message org.apache.commons.codec.binary.Base32
:at [java.net.URLClassLoader$1 run URLClassLoader.java 372]}]
:trace
[[java.net.URLClassLoader$1 run URLClassLoader.java 372]
...
和:
(use 'midje.repl)
CompilerException java.lang.IllegalArgumentException: No matching method: sha1Hex, compiling:(such/random.clj:17:3)
有了这些简单的依赖:
[[org.clojure/clojure "1.7.0"]
[org.clojure/data.json "0.2.6"]
[ring/ring-core "1.4.0"]
[ring/ring-jetty-adapter "1.4.0"]
[ring/ring-defaults "0.2.0"]
[necessary-evil "2.0.0"]
[compojure "1.5.0"]
[midje "1.8.1" :exclusions [org.clojure/clojure]]]
我可以通过添加到 deps 来修复它:
[commons-codec "1.6"]
[commons-codec "1.10"]
从我所见,需要 1.6 和 1.10,并且只有在我没有指定它的情况下才会下载 pom。如果我指定它,它会下载 jar 并且一切都很好。
没有它直接(只有pom):
/c/working/tooling-alerts> lein deps
Picked up JAVA_TOOL_OPTIONS: -Duser.home=C:\Users\harrisky
(:repositories detected in user-level profiles! [:user]
See https://github.com/technomancy/leiningen/wiki/Repeatability)
Retrieving commons-codec/commons-codec/1.10/commons-codec-1.10.pom from
直接使用它(添加后[commons-codec "1.10"]
):
/c/working/tooling-alerts> lein deps
Picked up JAVA_TOOL_OPTIONS: -Duser.home=C:\Users\harrisky
(:repositories detected in user-level profiles! [:user]
See https://github.com/technomancy/leiningen/wiki/Repeatability)
Retrieving commons-codec/commons-codec/1.10/commons-codec-1.10.jar from
因此,在这种情况下,问题似乎出在 midje - 但我猜这更多是嵌套依赖项和 lein 的问题。即,如果它是一个嵌套依赖项,则只下载 pom 而不是 jar。直接指定时,jar 也会被下载。
其他人看到这个问题并知道发生了什么吗?