leiningen

leiningen with multiple main classes

ε祈祈猫儿з 提交于 2019-12-02 20:48:38
I'd like to have two main classes (or more) with leiningen, and then be able to choose which one at the java command line. For example I have: (ns abc (:gen-class)) (defn -main [] (println "abc")) (ns def (:gen-class)) (defn -main [] (println "def")) With a project.clj having: (defproject my-jar "0.0.1" :description "test" :dependencies [ ] :main abc) Then I build with lein uberjar , and run: java -cp my-jar-0.0.1-standalone.jar abc java -cp my-jar-0.0.1-standalone.jar def I get it that when I specified :main abc in the project.clj it was calling that out as the main-class in the manifest, but

How do I recompile and reload Java source code while `lein repl` is running?

落花浮王杯 提交于 2019-12-02 19:38:35
I have a Clojure project, and I'm using leiningen. I'm also using tools.namespace to reload Clojure code while running a REPL. If I want to include Java source in the project, can I recompile and reload it while the REPL is running? What is the most convenient/dynamic way of doing it? Can I do it so that it works well with tools.namespace? I'm answering my own bounty here but I did do a bit of work getting this up: Use Vinyasa , and here is a blog post: Dynamic reloading of java code in emacs/nrepl ... actually... it's kinda not working anymore... you have to do back to the earlier versions in

New compojure template fails to start “No reader function for tag namespace”

假如想象 提交于 2019-12-02 17:53:28
问题 I'm attempting to run the boilerplate project from lein new compojure clojure-lice . When I run lein ring server I receive the following lovely error: Exception in thread "main" java.lang.RuntimeException: No reader function for tag namespace My project.clj (defproject clojure-lice "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :min-lein-version "2.0.0" :dependencies [[org.clojure/clojure "1.8.0"] [compojure "1.5.1"] [ring/ring-defaults "0.2.1"]]

Using clojure and leiningen with IDEs

£可爱£侵袭症+ 提交于 2019-12-02 17:41:21
I'm looking at switching my projects build from Ant to leiningen and wanted to know if there is a Clojure IDE (intellij, eclipse, netbeans) for which the "build" and "debug" buttons will still work? I have had some luck with La Clojure and the "Leiningen" plugin for IntelliJ IDEA. After creating a new project on the command line with lein new , I created a new project in IntelliJ. The Run Configuration Script Path needs to be pointed to the core.clj file, and the Module Settings "Dependencies" need to include the lib directory as a "Module Library." The Leiningen plugin offers the usual lein

Run tests from Clojure Repl and Leiningen

…衆ロ難τιáo~ 提交于 2019-12-02 17:27:58
As a newbie to clojure, I have used leiningen to create a sample project with lein new app first-project which gave me this directory . ├── doc │ └── intro.md ├── LICENSE ├── project.clj ├── README.md ├── resources ├── src │ └── first_project │ └── core.clj ├── target │ └── repl │ ├── classes │ └── stale │ └── extract-native.dependencies └── test └── first_project └── core_test.clj Without modifying any files, I can lauch successfully the only failing test with lein test ... Ran 1 tests containing 1 assertions. 1 failures, 0 errors. Tests failed. But I am unable to do the same from the REPL

Lein Clojure 1.3 vs Clojure 1.2.1

耗尽温柔 提交于 2019-12-02 13:48:04
问题 I admit this question is a bit poorly phrased. Please let me know what commands I should run to provide more information, and I will provide it. Context: I have been using Clojure for ~ 1 year now. Mainly just through the clojure repl. Now, I'm starting to use Lein. However, it leon does not like some of the code I have. Here is the info I have: $ lein version Leiningen 1.7.1 on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM When I run clojure manually, I get: Clojure 1.3.0 user=> (clojure

New compojure template fails to start “No reader function for tag namespace”

删除回忆录丶 提交于 2019-12-02 08:42:40
I'm attempting to run the boilerplate project from lein new compojure clojure-lice . When I run lein ring server I receive the following lovely error: Exception in thread "main" java.lang.RuntimeException: No reader function for tag namespace My project.clj (defproject clojure-lice "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :min-lein-version "2.0.0" :dependencies [[org.clojure/clojure "1.8.0"] [compojure "1.5.1"] [ring/ring-defaults "0.2.1"]] :plugins [[lein-ring "0.9.7"]] :ring {:handler clojure-lice.handler/app} :profiles {:dev {:dependencies [

Lein Clojure 1.3 vs Clojure 1.2.1

[亡魂溺海] 提交于 2019-12-02 04:02:20
I admit this question is a bit poorly phrased. Please let me know what commands I should run to provide more information, and I will provide it. Context: I have been using Clojure for ~ 1 year now. Mainly just through the clojure repl. Now, I'm starting to use Lein. However, it leon does not like some of the code I have. Here is the info I have: $ lein version Leiningen 1.7.1 on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM When I run clojure manually, I get: Clojure 1.3.0 user=> (clojure-version) "1.3.0" When I run $ lein repl REPL started; server listening on localhost port 12572 user=>

Clojure's :require and Instaparse

心已入冬 提交于 2019-12-02 01:11:25
问题 I am trying to use instaparse lib for my clojure project. I use leiningen 2.0 and clojure 1.5.1 in my project dependencies. I add instaparse to my project dependencies as follow: (defproject bachelor "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/clojure-contrib "1.2.0"] [instaparse "1.1.0"]]) And that is

Clojure's :require and Instaparse

北城余情 提交于 2019-12-01 20:21:14
I am trying to use instaparse lib for my clojure project. I use leiningen 2.0 and clojure 1.5.1 in my project dependencies. I add instaparse to my project dependencies as follow: (defproject bachelor "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/clojure-contrib "1.2.0"] [instaparse "1.1.0"]]) And that is my source where i'm trying to require that lib: (ns bachelor.data (:require [clojure.string :as str])