Clojure"已经提及" Hiccup与base-url的例外情况

时间:2015-09-03 12:00:55

标签: clojure leiningen apache-storm hiccup

我正在阅读Liberator的入门指南。在开始时,尝试评估上面的命名空间声明

(ns restserver.core
  (:require [liberator.core :refer [resource defresource]]
            [ring.middleware.params :refer [wrap-params]]
            [compojure.core :refer [defroutes ANY]]))

我得到了

;!!CompilerException java.lang.IllegalStateException: with-base-url already refers to: #'hiccup.core/with-base-url in namespace: hiccup.page, compiling:(hiccup/page.clj:1:1)

project.clj中声明的依赖项列表如下所示:

  :dependencies [[org.clojure/clojure "1.7.0"]
                 [liberator "0.13"]
                 [compojure "1.4.0"]
                 [org.apache.storm/storm-core "0.9.5"]
                 [org.clojure/data.json "0.2.6"]
                 [ring "1.4.0"]]

似乎storm-core依赖导致了这个问题,因为当我删除它时,问题就消失了。我该如何解决这个问题? (除了将与Storm相关的代码移动到单独的库中)?

更新:针对Storm项目JIRA发布了an issue,确切地说是针对此问题。

1 个答案:

答案 0 :(得分:0)

通过hiccup提供排除对象,尝试从storm-core中排除project.clj

:dependencies [[org.clojure/clojure "1.7.0"] [liberator "0.13"] [compojure "1.4.0"] [org.apache.storm/storm-core "0.9.5" :exclusions [hiccup]] [org.clojure/data.json "0.2.6"] [ring "1.4.0"]]