I'm setting up a compojure app, and I want to have datomic as my database - but as soon as I add the client-pro dependency, my app won't run.
Here's what I did:
Registered for an account
Downloaded datomic-pro
Created a transactor.properties and updated it with the license-key I received on my email
Ran bin/transactor transactor.properties
Opened another tab, and created a database:
(require ‘[datomic.api :as d])
(def db-uri “datomic:dev://localhost:4334/hello”)
(d/create-database db-uri)
Started a peer server on another tab
bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d hello,datomic:dev://localhost:4334/hello
Added [com.datomic/client-pro “0.8.28”] to my dependencies
When running lein ring server I am getting this error:
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.util.thread.NonBlockingThread
A Quick Aside
Not a direct answer, but if you are just looking for a fast start with Datomic, you can clone the Tupelo Datomic repo here:
https://github.com/cloojure/tupelo-datomic
It includes a pre-configured version of Datomic Free. Just run lein test to see it in action. You can then add your own code.
Regarding Jetty
The answer from Erwin may be all you need. Another possibility is that you may need to add in transitive dependencies at specific versions, and use :exclude on others. Please also note that in project.clj important deps MUST be listed at the top of the file, as these deps versions (and their transitive deps versions) WILL OVERRIDE any deps versions specified later.
I have lein deps for one project that look like this in project.clj:
:exclusions [cheshire
com.cognitect/transit-clj
com.cognitect/transit-cljs
com.cognitect/transit-java
com.cognitect/transit-js
com.fasterxml.jackson.core/jackson-core
com.fasterxml.jackson.core/jackson-databind
com.fasterxml.jackson.dataformat/jackson-dataformat-cbor
com.fasterxml.jackson.dataformat/jackson-dataformat-smile
joda-time/joda-time
org.eclipse.jetty/jetty-server]
:dependencies [
; fundamental items must come first to override later transitive dependencies
[cheshire "5.8.1"]
[com.cognitect/transit-clj "0.8.313"]
[com.cognitect/transit-cljs "0.8.256"]
[com.cognitect/transit-java "0.8.337"]
[com.cognitect/transit-js "0.8.861"]
[com.fasterxml.jackson.core/jackson-core "2.9.9"]
[com.fasterxml.jackson.core/jackson-databind "2.9.9"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.9.9"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.9.9"]
[joda-time/joda-time "2.10.3"]
[org.clojure/clojure "1.10.1"]
[org.eclipse.jetty/jetty-server "9.4.19.v20190610"]
then a list of 2nd-tier deps:
; high-priority libs, ensure these versions override any transitive dependency versions
[binaryage/devtools "0.9.10"]
[binaryage/oops "0.7.0"]
[com.andrewmcveigh/cljs-time "0.5.2"]
[com.cemerick/url "0.1.1"]
[org.clojure/core.async "0.4.500" :exclusions [org.clojure/tools.reader]]
[org.clojure/core.match "0.3.0"]
[org.clojure/test.check "0.9.0"]
[org.clojure/tools.cli "0.4.2"]
[org.clojure/tools.logging "0.5.0"]
[org.clojure/tools.nrepl "0.2.13"] ; #todo #awt upgrade => [nrepl "0.3.1"] from https://github.com/nrepl/nrepl
[prismatic/schema "1.1.11"]
[tupelo "0.9.144"]
[venantius/accountant "0.2.4"]
then 3nd-tier deps:
; "normal" dependency libs, whose transitive dependencies can be overridden by previous libs
[ch.qos.logback/logback-classic "1.2.3"]
[clj-http "3.10.0"]
[clj-time "0.15.1"] ; #todo switch to java.time & tupelo.java-time
[cljsjs/cytoscape "3.1.4-0"]
[com.amazonaws/aws-java-sdk "1.11.602" :exclusions [joda-time]]
[com.taoensso/carmine "2.19.1"]
[compojure "1.6.1"]
[cprop "0.1.14"]
[expound "0.7.2"]
[funcool/struct "1.4.0"]
[io.janusplatform/janus-environment-config "1.8.7-SNAPSHOT"]
[io.janusplatform/janus-logging-java "1.0.11-SNAPSHOT" :exclusions [com.google.guava/guava]]
[io.janusplatform/janus-resource-connector "4.3.0-SNAPSHOT"]
[jayq "2.5.5"]
[luminus-jetty "0.1.7" ]
[luminus-nrepl "0.1.6"]
[luminus/ring-ttl-session "0.3.3"]
[markdown-clj "1.10.0"]
[metosin/muuntaja "0.2.1"]
[metosin/ring-http-response "0.9.1"]
[metosin/spec-tools "0.10.0"]
[metosin/scjsv "0.5.0"]
[metrics-clojure-ring "2.10.0"]
[mount "0.1.16"]
[org.webjars/bootstrap "4.3.1"]
[org.webjars/font-awesome "5.9.0"]
[overtone/at-at "1.2.0"]
[ring-webjars "0.2.0"]
[ring/ring-codec "1.1.2"]
[ring/ring-core "1.7.1"]
[ring/ring-defaults "0.3.2"]
[ring/ring-json "0.4.0"]
[throttler "1.0.0"]
and some misc deps:
[amazonica "0.3.145" :exclusions [com.amazonaws/aws-java-sdk
com.fasterxml.jackson.core/jackson-core
com.fasterxml.jackson.dataformat/jackson-dataformat-cbor
org.apache.httpcomponents/httpclient]] ; #todo do we really need all these exclusions???
[cljs-ajax "0.8.0" :exclusions [cheshire
com.cognitect/transit-clj
com.cognitect/transit-java
org.apache.httpcomponents/httpasyncclient
org.apache.httpcomponents/httpcore
org.msgpack/msgpack]] ; #todo do we really need all these exclusions???
[org.springframework/spring-webmvc "5.1.8.RELEASE" :exclusions [org.springframework/spring-jcl
org.springframework/spring-aop]]
]
You can also see I had to exclude Jetty to prevent a transitive dependency from pulling in the wrong version, then specifically add in the version I wanted.
Related
I have a small Clojure project with /project.clj:
(defproject testjackson "0.1.0-SNAPSHOT"
:main testjackson.core
:dependencies [[org.clojure/clojure "1.10.3"]
[ring/ring-json "0.5.0"]])
and /src/testjackson/core.clj:
(ns testjackson.core
(:gen-class)
(:require [ring.middleware.json :refer [wrap-json-body]]))
(defn -main [& _] (println :testing wrap-json-body))
When I run it, it just prints:
$ java -jar target/testjackson-0.1.0-SNAPSHOT-standalone.jar
:testing #object[ring.middleware.json$wrap_json_body 0x37cd92d6 ring.middleware.json$wrap_json_body#37cd92d6]
It runs as expected. I can also execute jdeps on the uberjar to get the list of used modules:
$ jdeps --print-module-deps --ignore-missing-deps target/testjackson-0.1.0-SNAPSHOT-standalone.jar
java.base,java.desktop,java.sql,jdk.unsupported
However, when I bump ring-json version to 0.5.1, the jdeps call fails:
$ jdeps --print-module-deps --ignore-missing-deps target/testjackson-0.1.0-SNAPSHOT-standalone.jar
Exception in thread "main" java.lang.module.FindException: Module com.fasterxml.jackson.core not found, required by com.fasterxml.jackson.dataformat.smile
at java.base/java.lang.module.Resolver.findFail(Resolver.java:877)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:191)
at java.base/java.lang.module.Resolver.resolve(Resolver.java:140)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:422)
at java.base/java.lang.module.Configuration.resolve(Configuration.java:256)
at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:564)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)
How can this be fixed in the context of this small example program?
As near I as can find from searching, jdeps is from way back in Java 9. In fact, the version on my computer won't even accepts the 2 flags you used in the example, and it doesn't even have a --version option. Web searching shows no obvious uses for clojure.
What is the goal here? Your plain code works fine for me:
project.clj deps
:dependencies [
[org.clojure/clojure "1.11.1"]
[prismatic/schema "1.2.1"]
[ring/ring-json "0.5.1"]
[tupelo "22.05.24b"]
]
:plugins [[com.jakemccrary/lein-test-refresh "0.25.0"]
[lein-ancient "0.7.0"]
]
code
(ns demo.core
(:use tupelo.core)
(:require [ring.middleware.json :refer [wrap-json-body]])
(:gen-class))
(defn -main [& _]
(spyx (type wrap-json-body)))
and results
> lein clean ; lein run
(type wrap-json-body) => ring.middleware.json$wrap_json_body
Speculation
Although my jlink doesn't seem to work right, I can guess a little. Looking at project.clj, we can ask for a tree of depencencies:
> lein deps :tree
[nrepl "0.8.3" :exclusions [[org.clojure/clojure]]]
[org.clojure/clojure "1.11.1"]
[org.clojure/core.specs.alpha "0.2.62"]
[org.clojure/spec.alpha "0.3.218"]
[org.nrepl/incomplete "0.1.0" :exclusions [[org.clojure/clojure]]]
[prismatic/schema "1.2.1"]
[ring/ring-json "0.5.1"]
[cheshire "5.10.0"]
[com.fasterxml.jackson.core/jackson-core "2.10.2"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.10.2"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.10.2"]
[tigris "0.1.2"]
[ring/ring-core "1.9.2"]
[commons-fileupload "1.4"]
[commons-io "2.6"]
[crypto-equality "1.0.0"]
[crypto-random "1.2.0"]
[ring/ring-codec "1.1.3"]
[commons-codec "1.15"]
So we see that ring-json needs cheshire, which needs jackson.
Going back to ring-json 0.5.0 we see different version of cheshire and jackson:
> lein deps :tree
[nrepl "0.8.3" :exclusions [[org.clojure/clojure]]]
[org.clojure/clojure "1.11.1"]
[org.clojure/core.specs.alpha "0.2.62"]
[org.clojure/spec.alpha "0.3.218"]
[org.nrepl/incomplete "0.1.0" :exclusions [[org.clojure/clojure]]]
[prismatic/schema "1.2.1"]
[ring/ring-json "0.5.0"]
[cheshire "5.9.0"]
[com.fasterxml.jackson.core/jackson-core "2.9.9"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.9.9"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.9.9"]
[tigris "0.1.1"]
[ring/ring-core "1.7.1"]
[clj-time "0.14.3"]
[joda-time "2.9.9"]
[commons-fileupload "1.3.3"]
[commons-io "2.6"]
[crypto-equality "1.0.0"]
[crypto-random "1.2.0"]
[ring/ring-codec "1.1.1"]
[commons-codec "1.11"]
Note that you can force newer versions in project.clj if you want. Just manually require cheshire and jackson, and put them near the top!
:dependencies [
; priority 1 libs
[org.clojure/clojure "1.11.1"]
[cheshire "5.10.2"]
[com.fasterxml.jackson.core/jackson-core "2.13.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.13.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.13.3"]
; priority 2 libs
[prismatic/schema "1.2.1"]
[ring/ring-json "0.5.0"]
; [tupelo "22.05.24b"]
]
with result
> lcr
time (lein do clean, run)
:type ring.middleware.json$wrap_json_body
8.11s user 0.59s system 218% cpu 3.989 total
~/expr/demo >
~/expr/demo >
~/expr/demo > lein deps :tree
[cheshire "5.10.2"]
[tigris "0.1.2"]
[com.fasterxml.jackson.core/jackson-core "2.13.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.13.3"]
[com.fasterxml.jackson.core/jackson-databind "2.13.3"]
[com.fasterxml.jackson.core/jackson-annotations "2.13.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.13.3"]
[nrepl "0.8.3" :exclusions [[org.clojure/clojure]]]
[org.clojure/clojure "1.11.1"]
[org.clojure/core.specs.alpha "0.2.62"]
[org.clojure/spec.alpha "0.3.218"]
[org.nrepl/incomplete "0.1.0" :exclusions [[org.clojure/clojure]]]
[prismatic/schema "1.2.1"]
[ring/ring-json "0.5.0"]
[ring/ring-core "1.7.1"]
[clj-time "0.14.3"]
[joda-time "2.9.9"]
[commons-fileupload "1.3.3"]
[commons-io "2.6"]
[crypto-equality "1.0.0"]
[crypto-random "1.2.0"]
[ring/ring-codec "1.1.1"]
[commons-codec "1.11"]
Perhaps something similar will solve your problem. It has been crucial for me in the past.
Specifically, the jackson libs absolutely must
have all 3 sub-libraries on the same version. Because dependent libs
often don't update their own deps like jackson as often as they could, it is easy to get version conflicts when 2 or more libs each require different versions of jackson. The above technique of forcing a specific version of jackson (or any other lib) is a lifesaver. IMHO, it is also much better than trying to put in a bunch of lein :exclusions clauses.
I'm trying to use cljsjs/moment with an existing chestnut template app, but I get the following from figwheel
No such namespace: cljsjs.moment, could not locate cljsjs/moment.cljs, cljsjs/moment.cljc, or Closure namespace "cljsjs.moment"
Please see src/cljs/some_awesome_app/system.cljs
My dependencies:
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.854" :scope "provided"]
[com.cognitect/transit-clj "0.8.300"]
[ring "1.6.2"]
[ring/ring-defaults "0.3.1"]
[bk/ring-gzip "0.2.1"]
[radicalzephyr/ring.middleware.logger "0.6.0"]
[compojure "1.6.0"]
[environ "1.1.0"]
[com.stuartsierra/component "0.3.2"]
[org.danielsz/system "0.4.0"]
[org.clojure/tools.namespace "0.2.11"]
[org.omcljs/om "1.0.0-alpha48"]
[clj-http "3.7.0"]
[hiccup "2.0.0-alpha1"]
[cheshire "5.8.0"]
[cljsjs/moment "2.17.1-1"]] ;; <--- here it is
My main file:
(ns some-awesome-app.system
(:require [com.stuartsierra.component :as component]
[cljsjs.moment]
[some-awesome-app.components.ui :refer [new-ui-component]]))
I'm getting that error, without even using the library in my code..
Figured it out.
I'm using spacemacs with CIDER. And I was using jack-in instead of jack-in-clojurescript.
All works fine now.
I am building a server program to provide an API to a mongo database containing details of photos. All works well running it from the REPL, or if I start it using lein run.
The problems happen when I try and run the uberjar. Building the uberjar works ok:
(master) photo-api: lein uberjar
Compiling photo-api.env
Compiling photo-api.config
Compiling photo-api.core
WARNING: find-keyword already refers to: #'clojure.core/find-keyword in namespace: image-lib.core, being replaced by: #'image-lib.core/find-keyword
Compiling photo-api.db.core
Compiling photo-api.handler
Compiling photo-api.layout
Compiling photo-api.middleware
Compiling photo-api.routes.home
Compiling photo-api.routes.services
Created /Users/iain/Code/Clojure/Luminus/photo-api/target/uberjar/photo-api-0.1.0-SNAPSHOT.jar
Created /Users/iain/Code/Clojure/Luminus/photo-api/target/uberjar/photo-api.jar
(master) photo-api:
but running the jar gives an error:
(master) photo-api: java -jar target/uberjar/photo-api.jar
WARNING: find-keyword already refers to: #'clojure.core/find-keyword in namespace: image-lib.core, being replaced by: #'image-lib.core/find-keyword
read config from resource: "config.edn"
Exception in thread "main" java.lang.RuntimeException: could not start [#'photo-api.db.core/db*] due to
at mount.core$up$fn__420.invoke(core.cljc:92)
at mount.core$up.invokeStatic(core.cljc:92)
at mount.core$up.invoke(core.cljc:90)
at mount.core$bring.invokeStatic(core.cljc:210)
at mount.core$bring.invoke(core.cljc:202)
at mount.core$start.invokeStatic(core.cljc:252)
at mount.core$start.doInvoke(core.cljc:244)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at mount.core$start_with_args.invokeStatic(core.cljc:350)
at mount.core$start_with_args.doInvoke(core.cljc:346)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at photo_api.core$start_app.invokeStatic(core.clj:42)
at photo_api.core$start_app.invoke(core.clj:41)
at photo_api.core$_main.invokeStatic(core.clj:50)
at photo_api.core$_main.doInvoke(core.clj:49)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at photo_api.core.main(Unknown Source)
Caused by: java.lang.NullPointerException
at com.mongodb.ConnectionString.<init>(ConnectionString.java:222)
at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:189)
at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:171)
at monger.core$connect_via_uri.invokeStatic(core.clj:230)
at monger.core$connect_via_uri.invoke(core.clj:230)
at photo_api.db.core$fn__12620.invokeStatic(core.clj:29)
at photo_api.db.core$fn__12620.invoke(core.clj:28)
at mount.core$record_BANG_.invokeStatic(core.cljc:86)
at mount.core$record_BANG_.invoke(core.cljc:85)
at mount.core$up$fn__420.invoke(core.cljc:93)
... 18 more
Or the SNAPSHOT jar.
(master) photo-api: java -jar target/uberjar/photo-api-0.1.0-SNAPSHOT.jar
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Var
at photo_api.core.<clinit>(Unknown Source)
Caused by: java.lang.ClassNotFoundException: clojure.lang.Var
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
(master) photo-api:
What am I missing here? I'm guessing it's something to do with dev build and production build differences, but I can't spot anything obvious and the error messages are not a lot of help to me.
This is the project file which as far as I remember is mostly straight from the original luminus template:
(defproject photo-api "0.1.0-SNAPSHOT"
:description "API for geting data from photos db"
:url "http://soulflyer.com"
:dependencies [[cider/cider-nrepl "0.14.0"]
[clj-time "0.13.0"]
[com.google.guava/guava "20.0"]
[com.novemberain/monger "3.1.0" :exclusions [com.google.guava/guava]]
[compojure "1.6.0"]
[cprop "0.1.10"]
[funcool/struct "1.0.0"]
[luminus-immutant "0.2.3"]
[luminus-nrepl "0.1.4"]
[luminus/ring-ttl-session "0.3.2"]
[markdown-clj "0.9.99"]
[metosin/compojure-api "1.1.10"]
[metosin/muuntaja "0.3.1"]
[metosin/ring-http-response "0.9.0"]
[mount "0.1.11"]
[org.clojure/clojure "1.8.0"]
[org.clojure/tools.cli "0.3.5"]
[org.clojure/tools.logging "0.4.0"]
[org.clojure/data.json "0.2.6"]
[org.webjars.bower/tether "1.4.0"]
[org.webjars/bootstrap "4.0.0-alpha.5"]
[org.webjars/font-awesome "4.7.0"]
[org.webjars/jquery "3.1.1"]
[ring-webjars "0.2.0"]
[ring/ring-core "1.6.1"]
[ring/ring-defaults "0.3.0"]
[selmer "1.10.7"]
[image-lib "0.2.1-SNAPSHOT"]]
:min-lein-version "2.0.0"
:jvm-opts ["-server" "-Dconf=.lein-env"]
:source-paths ["src/clj"]
:test-paths ["test/clj"]
:resource-paths ["resources"]
:target-path "target/%s/"
:main ^:skip-aot photo-api.core
:plugins [[lein-cprop "1.0.3"]
[org.clojars.punkisdead/lein-cucumber "1.0.5"]
[lein-immutant "2.1.0"]]
:cucumber-feature-paths ["test/clj/features"]
:profiles
{:uberjar {:omit-source true
:aot :all
:uberjar-name "photo-api.jar"
:source-paths ["env/prod/clj"]
:resource-paths ["env/prod/resources"]}
:dev [:project/dev :profiles/dev]
:test [:project/dev :project/test :profiles/test]
:project/dev {:dependencies [[prone "1.1.4"]
[ring/ring-mock "0.3.0"]
[ring/ring-devel "1.6.1"]
[pjstadig/humane-test-output "0.8.2"]
[clj-webdriver/clj-webdriver "0.7.2"]
[org.apache.httpcomponents/httpcore "4.4"]
[org.clojure/core.cache "0.6.3"]
[org.seleniumhq.selenium/selenium-server "2.48.2"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.19.0"]
[refactor-nrepl "2.3.0-SNAPSHOT"]]
:source-paths ["env/dev/clj"]
:resource-paths ["env/dev/resources"]
:repl-options {:init-ns user}
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}
:project/test {:resource-paths ["env/test/resources"]}
:profiles/dev {}
:profiles/test {}})
I think you're just missing required configuration - at least Mongo connection string.
When running in dev mode, the luminus (and cprops configuration library) uses the config from your profiles.clj.
However, this is the leiningen thing and it's not available when running from uberjar.
You can specify all your "production" configuration in "config.edn" file and run uberjar like this:
java -Dconf=config.edn -jar target/uberjar/photo-api.jar
You can also use java system properties to set configuration values one by one.
See http://www.luminusweb.net/docs/environment.md for more details.
I'm making a Clojure/ClojureScript website that I deploy on Heroku. I'm using Leiningen for project management.
I want to write my stylesheets in LESS. I need the build process to compile the LESS files into CSS, then minify these CSS files; obviously, I do not want the generated CSS files to be under version control.
LESS files --lein-less--> CSS files --lein-asset-minifier--> minified CSS files
I have tried to implement this with the lein-less and lein-asset-minifier Leiningen plugins. My attempt consisted of declaring leiningen.less and minify-assets.plugin/hooks as hooks of the :uberjar task, in proper order (see code below). But running lein uberjar fails with the following error:
Uberjar aborting because jar failed: resources/public/css/site.css (No such file or directory)
So it appears the order of build steps is not enforced.
Is it possible to implement this multi-step build with these Leiningen plugins? If not, how are people doing it?
Code
Here is the relevant part of my project.clj :
(defproject sncf-cljs "0.1.0-SNAPSHOT"
;; ...
:min-lein-version "2.5.0"
:source-paths ["src/clj" "src/cljs"]
:dependencies [
;; ...
]
:plugins [
[lein-cljsbuild "1.0.4"]
[lein-environ "1.0.0"]
[lein-ring "0.9.1"]
[lein-asset-minifier "0.2.2"]
[lein-less "1.7.2"]]
:less {:source-paths ["src/less"]
:target-path "resources/public/css"}
:uberjar-name "sncf-cljs.jar"
:minify-assets {:assets
{"resources/public/css/site.min.css" "resources/public/css/site.css"}}
:cljsbuild {
;; ...
}
:profiles {
;; ...
:uberjar {:hooks [leiningen.less
leiningen.cljsbuild
minify-assets.plugin/hooks]
:env {:production true}
:aot :all
:omit-source true
:cljsbuild {:jar true
:builds {:app
{:source-paths ["env/prod/cljs"]
:compiler
{:optimizations :advanced
:pretty-print false}}}}}
:production {:ring {:open-browser? false
:stacktraces? false
:auto-reload? false}
:cljsbuild {:builds {:app {:compiler {:main "sncf-cljs.prod"}}}}
}})
I did some research because it is an interesting question. So I looked around, and could not find informations how to configure this. So I continued to search and I found a plugin for this task.
https://github.com/kumarshantanu/lein-cascade
The readme on the github page should be sufficient to solve this task.
When building a lein-droid project with [clj-http "0.7.7"] as a dependency in project.clj, it fails with the following error [0]:
Compiling cheshire.jsonp
Exception in thread "main" java.lang.ClassNotFoundException: javax.json.Json, compiling:(jsonp.clj:1:1)
[...]
Caused by: java.lang.ClassNotFoundException: javax.json.Json
[...]
Replacing the dependency with [cheshire "5.2.0"] (current version) produces the same error. Lowering the version to "5.1.1" removes this error.
Adding [clj-http "0.7.7"] as a dependency to the project introduces a new error [1]:
Compiling clj-http.conn-mgr
Exception in thread "main" java.lang.ClassCastException clj_http.conn_mgr$fn$reify__20 cannot be cast to java.security.KeyStore, compiling:(conn_mgr.clj:13:3)
[...]
Caused by: java.lang.ClassCastException: clj_http.conn_mgr$fn$reify__20 cannot be cast to java.security.KeyStore
[...]
Relevant settings from project.clj (set from the lein-droid tutorial):
:javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
:android { ...
:target-version "16"
...}
Changing these settings to the current version numbers doesn't change the error.
With cheshire 5.2.0
» lein deps :tree
WARNING!!! possible confusing dependencies found:
[clojure-complete "0.2.3"]
overrides
[clojure-complete "0.2.3"]
[cheshire "5.1.1"]
overrides
[clj-http "0.7.7"] -> [cheshire "5.2.0"]
Without cheshire in dependencies
» lein deps :tree
WARNING!!! possible confusing dependencies found:
[org.clojure/data.json "0.2.3"] -> [org.clojure/clojure "1.4.0"]
overrides
[clj-http "0.7.7"] -> [cheshire "5.2.0"] -> [tigris "0.1.1"] -> [org.clojure/clojure "1.5.1"]
[clojure-complete "0.2.3"]
overrides
[clojure-complete "0.2.3"]