如何在Clojure中解决此依赖性问题?
我在修复两个不同包的依赖关系冲突的问题时遇到了很多麻烦。My project.clj的依赖项如下所示:如何在Clojure中解决此依赖性问题?,clojure,jackson,dependencies,leiningen,amazonica,Clojure,Jackson,Dependencies,Leiningen,Amazonica,我在修复两个不同包的依赖关系冲突的问题时遇到了很多麻烦。My project.clj的依赖项如下所示: :dependencies [[org.clojure/clojure "1.6.0"] [itsy "0.1.1"] [amazonica "0.3.22" :exclusions [commons-logging org.apache.httpcomponents/httpclient com.fasterxml.
:dependencies [[org.clojure/clojure "1.6.0"]
[itsy "0.1.1"]
[amazonica "0.3.22" :exclusions [commons-logging org.apache.httpcomponents/httpclient com.fasterxml.jackson.core/jackson-core]]])
(ns crawler.core
(:require [itsy.core :refer :all])
(:require [itsy.extract :refer :all])
(:use [amazonica.core]
[amazonica.aws.s3]))
我的命名空间如下所示:
:dependencies [[org.clojure/clojure "1.6.0"]
[itsy "0.1.1"]
[amazonica "0.3.22" :exclusions [commons-logging org.apache.httpcomponents/httpclient com.fasterxml.jackson.core/jackson-core]]])
(ns crawler.core
(:require [itsy.core :refer :all])
(:require [itsy.extract :refer :all])
(:use [amazonica.core]
[amazonica.aws.s3]))
当我尝试使用(load crawler/core)
将名称空间加载到lein的repl中时,出现以下错误:
CompilerException java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z, compiling:(amazonica/core.clj:1:1)
在线消息来源表明,这是一种依赖不匹配。如何修复它?我将排除在itsy而不是amazonica上,它成功了。还修复了core.clj中的NS表单 project.clj:
(defproject blabla "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.6.0"]
[itsy "0.1.1" :exclusions [com.fasterxml.jackson.core/jackson-core]]
[amazonica "0.3.22" :exclusions [commons-logging org.apache.httpcomponents/httpclient]]])
core.clj:
(ns blabla.core
(:require [itsy.core :refer :all]
[itsy.extract :refer :all]
[amazonica.core :refer :all]
[amazonica.aws.s3 :refer :all]))
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
一般来说,要处理这些情况
莱恩·戴普斯:树
并添加排除项,直到只剩下最新版本。您是否可以包含运行“lein deps:tree”的输出部分,其中提到itsy或amazonica。输出中也很可能会有建议的排除。今晚晚些时候我会试试这个。实际上,我按照你的建议运行leindeps:tree并添加排除,直到它停止提供建议。我就是这样做到的。