leiningen

Unexpected Difficulties with “Hello, World!”

旧城冷巷雨未停 提交于 2019-12-01 18:03:20
问题 I would like to learn Clojure and I've downloaded and set up the following gizmos: Clojure 1.6.0 from official site; Leiningen 2.4.3; Cider 0.6.0 from GitHub. I've got it working. Now I'm trying to print message "Hello, World!" , while running Cider from within Emacs: ; CIDER 0.6.0 (Java 1.7.0_65, Clojure 1.6.0, nREPL 0.2.0-beta5) user> (println "Hello World!") Hello World!NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn--7630

Leiningen compilation order?

若如初见. 提交于 2019-12-01 18:00:11
I'm just learning how to lein , and I'd like to use from a Java source a class created by deftype in a Clojure source. This wasn't covered in the basic tutorial and I can't get it to work properly. The problem is that Java source can't import Clojure class, since it hasn't been compiled yet. And Clojure class isn't compiled, since compilation is aborted by the Java source. I give a minimal example: Create a new project with: lein new app javafoo Add to project.clj :aot :all :java-source-paths ["src/java"] Put into src/javafoo/core.clj : (ns javafoo.core) (deftype PPoint [x y]) Put into src

Unexpected Difficulties with “Hello, World!”

耗尽温柔 提交于 2019-12-01 17:47:40
I would like to learn Clojure and I've downloaded and set up the following gizmos: Clojure 1.6.0 from official site; Leiningen 2.4.3; Cider 0.6.0 from GitHub. I've got it working. Now I'm trying to print message "Hello, World!" , while running Cider from within Emacs: ; CIDER 0.6.0 (Java 1.7.0_65, Clojure 1.6.0, nREPL 0.2.0-beta5) user> (println "Hello World!") Hello World!NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl.middleware.session/session-out/fn--7630 (session.clj:43)NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I clojure.tools.nrepl

Why `lein uberjar` evaluates variables defined with `def`?

自古美人都是妖i 提交于 2019-12-01 16:56:28
I'm trying to understand "Lieningen" behaviour when creating an uberjar . Following is the minimal example which reproduces the behaviour: (ns my-stuff.core (:gen-class)) (def some-var (throw (Exception. "boom!"))) (defn -main [& args] (println some-var)) When this is executed with lein run it clearly fails with an Exception. However, I don't understand why executing lein uberjar also fails with an Exception from variable definition? Why executing lein uberjar attempts to evaluate the variable value? Is this speecific to uberjar task or am I missing something more substantial about Clojure or

Why `lein uberjar` evaluates variables defined with `def`?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 15:45:51
问题 I'm trying to understand "Lieningen" behaviour when creating an uberjar . Following is the minimal example which reproduces the behaviour: (ns my-stuff.core (:gen-class)) (def some-var (throw (Exception. "boom!"))) (defn -main [& args] (println some-var)) When this is executed with lein run it clearly fails with an Exception. However, I don't understand why executing lein uberjar also fails with an Exception from variable definition? Why executing lein uberjar attempts to evaluate the

Clojure jdbc create-table statement does not run unless using Leiningen REPL

故事扮演 提交于 2019-12-01 15:09:39
问题 I've got a small Clojure program that uses the Clojure JDBC tools to create a table in an HSQL database. However, it only seems to actually create the table if I run it from Leiningen's REPL. It does not create the table if I run the code using lein run or from my IDE (IntelliJ). There are no exceptions reported. In both cases, the output is just "(0)". Here's the code snippet: (ns tramway.core (:require [clojure.java.io :as io] [clojure.java.jdbc :as sql])) (def hsql-db {:subprotocol "hsqldb

How do I do exclusions for dependencies that are pulled in by leiningen when writing a plugin?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 07:02:23
问题 I'm writing a custom plugin for Leiningen that will help in deploying AWS Lambda functions written in Clojure. I'm using aws-java-sdk-lambda version 1.11.145 which has a dependency on Jackson 2.6.x , specifically 2.6.5 IIRC. Since I am writing this as a plugin, the code is executing in the context of Leiningen (i.e. :eval-in-leiningen true ) and, AFAIK, is subject to the dependencies of Leiningen itself. This is a problem since the version of Leiningen I am running ( 2.7.1 ) is dependent on

How do I exclude jars from a leiningen project?

て烟熏妆下的殇ゞ 提交于 2019-12-01 05:13:29
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 changing the order of lein classpath. from bin/lein <--- *2* CLASSPATH="$CLASSPATH:$LEIN_LIBS:$LEIN_DIR

How to configure leiningen to use newest Clojure version for repl started outside of project?

纵然是瞬间 提交于 2019-12-01 04:18:21
When I start clojure repl for specific project, for leiningen is enough to specify correct clojure version in the concrete project.clj file as described here . But when I start repl outside the project then the older version is started. In my case the older version is 1.5.1 and I want to upgrade to 1.6.0 . Here has proposed not working solution, but in the comments bellow is said that in lieingen version 2.1 the problem is resolved. I'm with version 2.3.4 of leiningen but the proposed solution doesn't work for me. according to technomancy on IRC: "repls outside projects are hard coded to lein

Use Leiningen With Local M2 Repository

可紊 提交于 2019-12-01 03:03:52
I want to compile a local jar into my clojure project, I can do this easily with the following https://gist.github.com/stuartsierra/3062743 mkdir repo mvn install:install-file -DgroupId=local -DartifactId=bar \ -Dversion=1.0.0 -Dpackaging=jar -Dfile=bar.jar \ -DlocalRepositoryPath=repo But I have a continuous integration and build server (jenkins) that looks in ~/.m2. How can I get leiningen to look in .m2??? Based on the documentation , it looks like the key you're after is :local-repo in project.clj . Since you want to have different local repository locations on different servers, I would