0

I am going through Liberator's Getting Started guide. At the very beginning, when trying to evaluate the above namespace declaration

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

i get

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

List of declared dependencies in project.clj looks like this:

  :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"]]

It seems that storm-core dependency is causing this issue, as when i remove it, the problem is gone. How can i fix this problem? (apart from moving Storm-related code to a separate library)?

UPDATE: there is an issue on Storm project JIRA posted for exactly this problem.

siphiuel
  • 3,480
  • 4
  • 31
  • 34
  • I am not an expert in Clojure.... However, it seems that the dependency is kind of a duplicate. Does storm-core somehow includes the same dependency resulting in a conflict? Is it possible to "remove" transitive dependencies? – Matthias J. Sax Sep 03 '15 at 12:31
  • I don't have the time to write a full answer right now, but this is fixed with the `:provided` key which describes deps that will be provided by the host at runtime – noisesmith Sep 03 '15 at 14:46

1 Answers1

0

Try excluding hiccup from the storm-core by providing exclusions on 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"]]

Saeid Akbari
  • 115
  • 8