leiningen

How to open existing Clojure project in Eclipse?

為{幸葍}努か 提交于 2019-12-05 22:09:46
Ive tried to do it usual way File -> Import -> General -> Existing project (as for java projects) BUT eclipse dont see clojure projects and cannot open it :( do you have any idea why ? Install Counterclockwise plugin in Eclipse (from eclipse marketplace). This brings clojure and leiningen support to eclipse. Add lein2-eclipse plugin to your project.clj : :plugins [[lein2-eclipse "2.0.0"]] Run following command inside the project directory : lein eclipse This generates necessary project files. Import the project into eclipse ( File -> Import -> General -> Existing project ). Right click on the

Is there a way to set system properties in leinegen?

只愿长相守 提交于 2019-12-05 20:01:09
问题 Starting a lein task (actually test , which runs by default with the :test profile). What I'd like to do is start with the equivalent of java -Dproperty1=value -Dproperty2=value2 task There are some references on the web that suggest that this should work fine like this: project.clj: ... :profiles {:test {:jvm-opts ["-Dproperty1=value" "-Dproperty2-value"]}} This is ignored in my test runner. The profile is correct, If I insert some actual jvm args (e.g something like "-XX:+PrintGC") it works

How can I add a build step to leiningen?

淺唱寂寞╮ 提交于 2019-12-05 17:13:25
So I've got an application built using Foundation and Ring, and I want to be able to compile my custom Foundation CSS whenever I run lein ring server or the like. Specifically, I'd like to be able to add a step the runs compass compile [path] . What's the idiomatic way to do this? I would say, Leiningen Hooks are the proper and idiomatic way to do so: Hooks . You can modify the behaviour of built-in tasks to a degree using hooks. Hook functionality is provided by the Robert Hooke library, which is included with Leiningen. 来源: https://stackoverflow.com/questions/18199188/how-can-i-add-a-build

How can I deploy a Leiningen template to Clojars?

余生长醉 提交于 2019-12-05 12:32:14
I have created a Leiningen project on my local machine which I then turn into a template by doing: lein create-template webdb : Then I install the template: cd webdb lein install : which allows me to create projects based on the template locally: lein new webdb anewproject : Everything works fine up to here. However if I try to deploy the template to clojars using: cd webdb lein deploy clojars : then whenever I try to use the clojars profile to create a template I get an error: lein new org.clojars.zubairq2/webdb anothernewproject : gives the error: Could not find metadata org.clojars.zubairq2

Is there a standalone Clojure package within Leiningen?

蓝咒 提交于 2019-12-05 11:44:58
After installing leiningen with this script https://raw.github.com/technomancy/leiningen/preview/bin/lein , I can use the repl by typing lein repl , so I think the clojure has already been installed by leiningen . Do I need to download the JAR of the clojure again from the offical site? If there's no need to do this, where's the JAR file of clojure that leiningten depends on? What I've found with lein is installing it and then depending on a specific version of Clojure causes that version to be fetched, and the .jar file winds up in the maven repository. (defproject repl-test "0.0.1-SNAPSHOT"

Why can't Leiningen always use my :gen-class properly?

放肆的年华 提交于 2019-12-05 10:45:23
Let's say I create a new Leiningen project ( lein new app example ) and add some code in example/src/example/core.clj that makes use of :gen-class : (ns example.core (:gen-class :extends javafx.application.Application)) (defn -start [this stage] (.show stage)) (defn -main [& args] (javafx.application.Application/launch example.core args)) If I then create a JAR ( lein uberjar ) and run it, everything works fine. However, if I instead try to run my app directly ( lein run ), I get a ClassNotFoundException . In addition, if I open a REPL ( lein repl ), I first get the same error as before, but

how to package resources in a leiningen project

*爱你&永不变心* 提交于 2019-12-05 10:43:30
in the sample project, https://github.com/technomancy/leiningen/blob/master/sample.project.clj on line 217 , there is a directive for including non-code files : :resource-paths ["src/main/resource"] ; non-code files included in classpath/jar I have a resources folder in my project and this line in my project.clj :resource-paths ["resources"] ; non-code files included in classpath/jar however, when I run lein jar to generate the .jar file, it does not package up the resources folder. Is there something that I am missing? zcaudate Actually, it did get packaged. I just was not looking in the

lein REPL server launch timed out

孤街醉人 提交于 2019-12-05 10:14:49
问题 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 [

How to setup the classpath when running the jar made from 'lein uberjar'?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 09:02:16
I have a hello.clj as follows. (ns hello) (defn hi [] (println "HI")) Normally, I can use this function from main.clj as follows. The hello.clj is in the same directory that contains main.clj. And the classpath includes . (current path). (use 'hello) (hi) How can I use this hello.clj for the 'lein uberjar'? I used 'lein new myproject; lein deps' to get the following structure. . |-- README |-- classes | `-- myproject |-- lib | |-- clojure-1.2.0-beta1.jar | |-- clojure-contrib-1.2.0-beta1.jar | `-- lucene-core-3.0.2.jar |-- project.clj |-- src | `-- myproject | `-- core.clj `-- test `--

New console window when developing in the repl

混江龙づ霸主 提交于 2019-12-05 06:48:52
问题 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