簡體   English   中英

如何在Clojure中解決此依賴性問題?

[英]How do I fix this dependency issue in Clojure?

解決兩個不同軟件包的依賴項沖突的問題時,我遇到很多麻煩。 我的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.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)

在線資源表明這是依賴性不匹配。 我如何解決它?

我將排除法放在了ity而不是amazona上,它起作用了。 還修復了NS形式在core.clj中。

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!"))

在一般情況下應對這些情況

萊因·德普斯:tree

並添加排除項,直到僅保留最新版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM