leiningen

simple tool for compiling Clojure .clj into .class / .jar

≯℡__Kan透↙ 提交于 2019-12-04 03:37:15
问题 I've found two ways of compiling Clojure *.clj files into *.class files, and while they both work, I have some gripes with both of them. The first one uses a REPL and so cannot be automated (or can it?) The second one uses lein . To be frank I don't see why I should use a dependency management tool for something that should be part of the core tool-chain of the language. But in any case, using lein soon forces you to use a local Maven repository if your Clojure code needs to access local jars

Jar produced with lein uberjar fails on NoClassDefFoundError

烂漫一生 提交于 2019-12-04 03:23:26
问题 I have a simple web app with this project.clj: (defproject squirrel-money "1.0.0-SNAPSHOT" :description "Squirrel Money" :dependencies [[org.clojure/clojure "1.2.0"] [org.clojure/clojure-contrib "1.2.0"] [compojure "0.5.3"] [ring/ring-jetty-adapter "0.3.5"] [hiccup "0.3.1"] [postgresql "8.4-701.jdbc4"] [clj-time "0.2.0-SNAPSHOT"]] :dev-dependencies [[lein-eclipse "1.0.0"]] :main squirrel-money.main :repl-init-script "src/squirrel_money/init_repl.clj") My main looks like this: (ns squirrel

How do I exclude jars from a leiningen project?

假如想象 提交于 2019-12-04 01:24:25
问题 While using Leiningen, I got the following abrupt error: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.getFileUtils()Lorg/apache/tools/ant/util/FileUtils; (core.clj:1) I found the following answer at https://github.com/technomancy/leiningen/issues/194: if ant version 1.6.1 is included in a project, lein fails. Autodoc "0.7.1" includes ant version 1.6.1. a work around is to exclude ant.1.6.1 in the project.clj. <--- *1* But a better solution is

Improving startup time of Clojure REPL with Leiningen on the Raspberry Pi

牧云@^-^@ 提交于 2019-12-03 23:18:42
I got a Rasperry Pi 512 MB version (late 2012) and installed the Developer Preview of Java SE 8 for ARM on it. When I create a new Clojure project with Leiningen and launch the nREPL by doing lein repl it takes a bit more than two minutes (roughly 130 - 140 seconds) until the REPL has been initialized and can be used. When launching the JAR file directly java -jar clojure-1.4.0/clojure-1.4.0 the REPL starts up in 25s. I'm using fast class 10 SD cards (SanDisk Extreme with up to 30 MB/s). How come that the difference between using Leiningen with nRepl vs launching the JAR file is so big? What

lein REPL server launch timed out

社会主义新天地 提交于 2019-12-03 22:43:42
in a liberator based clojure project we are using datomic as DB. After migrating our local dev DB to a S3 hosted one and adding the needed dependencies on our project.clj we cannot launch the REPL but the Liberator stack runs fine through lein run My guess is that the DB connection is messing things up, so, the question is, how can I somehow "debug" or figure out what's the reason of this lein repl timeout? My project.clj (defproject myproject "0.1.0-SNAPSHOT" :main myproject.core :jvm-opts ["-Xmx1G"] :datomic {:schemas ["resources" ["myproject-schema.edn" ]]} :plugins [[lein-ring "0.8.10"]] ;

New console window when developing in the repl

不羁岁月 提交于 2019-12-03 21:33:46
If I'm developing, let's say, a console text editor, how could I call a new console frame from the lein repl? (or any repl) If it's called (main "file.txt") from the repl it would be 'popped' a new console window with the the file.txt content where I could edit. 来源: https://stackoverflow.com/questions/40961962/new-console-window-when-developing-in-the-repl

How to disable Clojure assertions, including preconditions?

馋奶兔 提交于 2019-12-03 20:16:16
What are some good ways to disable Clojure assertions (including preconditions and postconditions) in the REPL? For an arbitrary Leiningen profile? David J. Per https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L286 Set :global-vars to {*assert* false} in your profiles.clj . You can put the above setting in whatever Leiningen profiles you want. 来源: https://stackoverflow.com/questions/24949418/how-to-disable-clojure-assertions-including-preconditions

How do I use checked-in jars with leiningen

大兔子大兔子 提交于 2019-12-03 18:49:29
问题 We have some 3rd-party jars checked-in to our project. We'd like to add them to the classpath. That's it. We don't want to set up a local maven repo (because that would break our 'check out and run' philosophy). Each developer would have to set up their own maven repo, distinct from the project. Is there a way to do this or is this? Most of the answers I've seen say to set up a local maven which we don't want or need just to add a jar to a classpath. 回答1: You will need to setup a local maven

Stopping infinite loops while running clojure tests in emacs with leiningen and swank/slime

本小妞迷上赌 提交于 2019-12-03 16:34:46
问题 In certain kinds of code it's relatively easy to cause an infinite loop without blowing the stack. When testing code of this nature using clojure-test, is there a way to abort the current running tests without restarting the swank server? Currently my workflow has involved $ lein swank Connect to swank with emacs using slime-connect , and switch to the the tests, execute with C-c C-, , tests run until infinite loop, then just return but one cpu is still churning away on the test. The only way

How to install a leiningen plugin?

女生的网名这么多〃 提交于 2019-12-03 16:29:46
问题 How do I install a leiningen plugin? For example, leiningen-run? I see this thing called "clojars.org", and how to "push" to it, but I don't see anything about "pulling" from it. 回答1: If a plugin's available at Clojars, like lein run is, just add it to your project's :dev-dependencies in project.clj, then say lein deps in your project's directory to have Leiningen pull in all dependencies . An annotated excerpt from lein run's docs: (defproject island-wari "0.1" :description "Web application