I have two files of interest: build.boot
(set-env! :source-paths #{"src/clj" "src/cljs" "test/clj"} :resource-paths #{"html" "target/main.js"} :dependencies '[[adzerk/boot-cljs "0.0-3308-0"] [adzerk/boot-cljs-repl "0.1.10-SNAPSHOT"] [adzerk/boot-reload "0.3.1"] [adzerk/boot-test "1.0.4"] [cljsjs/hammer "2.0.4-4"] [compojure "1.3.1"] [com.datomic/datomic-pro "0.9.5186"] [hiccup "1.0.5"] [org.clojure/clojure "1.7.0-RC1"] [org.clojure/clojurescript "0.0-3308"] [org.clojure/core.async "0.1.346.0-17112a-alpha"] [org.clojure/test.check "0.7.0"] [org.omcljs/om "0.8.8"] [pandeiro/boot-http "0.6.3-SNAPSHOT"] [ring/ring-devel "1.4.0-RC1"] [http-kit "2.1.18"]]) (require '[adzerk.boot-cljs :refer [cljs]] '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]] '[adzerk.boot-reload :refer [reload]] '[adzerk.boot-test :refer [test]] '[pandeiro.boot-http :refer [serve]]) (task-options! cljs {:source-map true :optimizations :none :pretty-print true}) (deftask build "Build an uberjar of this project that can be run with java -jar" [] (comp (cljs) (aot :namespace '#{vidiot.server}) (pom :project 'vidiot :version "0.1.0") (uber) (jar :main 'vidiot.server)))
and src / clj / vidiot / server.clj
(ns vidiot.server (:gen-class) (:require [compojure.core :refer :all] [compojure.route :as route] [hiccup.core :refer :all] [org.httpkit.server :refer :all] [ring.middleware.reload :as reload] [ring.util.response :as response])) (defonce server (atom nil)) (defroutes all-routes (GET "/" [] (response/redirect "index.html")) (GET "/ws" [request] (with-channel request channel (on-close channel (fn [status] (println "channel closed: " status))) (on-receive channel (fn [data] ;; echo it back (send! channel data))))) (route/files "/" {:root "target"}) (route/not-found (response/response (html [:div#erro "Page Not Found"])))) (defn -main [& args] (run-server all-routes {:port 8080}))
Then I,
> boot build > java -jar target/vidiot-0.1.0.jar
Then, going to localhost: 9090 in my browser, the terminal prints.
java.lang.IllegalArgumentException: No implementation of method: :route-matches of protocol:
I can fix this problem by lowering : dependencies in build.boot to [compojure "1.1.6"] .
So my question is: why can't I use [compojure "1.3.4"] (the latest version when writing) when creating my uberjar?
source share