leiningen

Leiningen equivalent for maven dependency `type` element

[亡魂溺海] 提交于 2021-02-07 07:27:40
问题 I'm trying to follow this java tutorial for neo4j testing, but in Clojure. I'm using Leiningen for my dependency management, but that tutorial uses maven. According to the tutorial, maven would take the following dependency XML: <dependencies> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-kernel</artifactId> <version>2.0.0</version> <type>test-jar</type> <scope>test</scope> </dependency> ... </dependencies> It also says: Observe that the test-jar is crucial. Without it you would

What's the correct way of providing a default value for *print-length* in profiles.clj?

余生颓废 提交于 2021-01-22 13:37:22
问题 For those that do not know what *print-length* stands for: If you (set! *print-length* 200) , and you evaluate (range) in a REPL, which normally causes an infinite list of numbers to get printed, only the first 200 numbers will get printed. I'm trying to set this as a default for all my REPLs in profiles.clj . Right now I got this, but it doesn't work: {:user {:plugins [[lein-swank "1.4.4"] [lein-catnip "0.5.0"]] :repl-options {*print-length* 200}} :dev {:dependencies [[clj-ns-browser "1.2.0"

Local dependencies in Leiningen without creating a Maven repo?

时光毁灭记忆、已成空白 提交于 2020-01-22 19:28:12
问题 I'm building a Compojure web application, and I'd like it to use functions from another Clojure project I wrote. I'm not at all familiar with Maven, and from what I've heard, it has a very steep learning curve. Unfortunately, everything I've seen suggests using a private Maven repo as a dependency and doesn't suggest an alternative. I'd really like to avoid struggling with Maven if possible. Does anyone know of an alternative? I'm currently using the latest version of Leiningen. 回答1: If the

Clojure swing app startup time

元气小坏坏 提交于 2020-01-13 11:28:10
问题 I just started making a GUI app using clojure and seesaw. It does little more that create a JFrame and a couple components. Here's the code. The main function does nothing but call start-gui and exit as soon as it returns. (ns pause.gui (:use seesaw.core)) (native!) ; (javax.swing.UIManager/setLookAndFeel ; "org.pushingpixels.substance.api.skin.SubstanceGraphiteLookAndFeel") (def main-window (frame :title "Pause" :on-close :exit)) (def sidebar (listbox :model [])) (def main-area (text :multi

Why do I lose all symbols when using in-ns to move to a new namespace?

浪尽此生 提交于 2020-01-11 10:47:09
问题 Running the following code in a Leiningen REPL: (in-ns 'my-namespace.core) (+ 2 2) results in this error: CompilerException java.lang.RuntimeException: Unable to resolve symbol: + in this context Why? 回答1: When you create a new namespace using in-ns , the core namespace ( clojure.core ) is not referred by default. "Referring" a namespace means including it in your namespace in such a way that you can refer to that namespace's symbols as your own. It is still possible to use symbols from

Using lein project with /lib doesn't work

爱⌒轻易说出口 提交于 2020-01-11 03:19:14
问题 When using lein 2.2, trying to put jar files in /lib does not work. I tried and it doesn't seems to work but plenty of docs out there says this way still works. 回答1: The lib directory functionality was removed in Leiningen v2.0, in favor of a repository (repeatability). To add free floating jars to a project, you will need to either deploy your dependency to Clojars or a Maven repository. The Maven repository can be as simple as a directory in your project folder. Please see the answer to

What are the leiningen default repositories?

依然范特西╮ 提交于 2020-01-11 01:56:51
问题 Leiningen (https://github.com/technomancy/leiningen) looks into some default repositories to satisfy the dependencies specified in your project.clj. I want to browse these repositories to see what's available out-of-the-box in leiningen. What are these repos and where can I look them up for my specific version of leiningen. 回答1: As of the time of writing, leiningen uses the following default repositories: "central" - http://repo1.maven.org/maven2 "clojure" - http://build.clojure.org/releases

lein run exits without running all of my -main function

╄→гoц情女王★ 提交于 2020-01-05 04:10:09
问题 Here's my project.clj : (defproject fixurls "0.1.0-SNAPSHOT" :description "Fixurls" :url "https://github.com/swizzard/fixurls" :license {:name "WTFPL" :url "http://www.wtfpl.net/"} :dependencies [[org.clojure/clojure "1.5.1"] [clj-http "0.9.2"] [org.clojure/data.json "0.2.4"] [me.raynes/fs "1.4.4"] ] :plugins [[lein-gorilla "0.2.0"]] :jvm-opts ["-Xmx4g" "-Xms2g" "-Xss1g" "-server"] :main ^:skip-aot fixurls.core ) Here's ~/clojure-stuff/fixurls/src/core.clj : (ns fixurls.core (:require [clj

Automating Leiningen local dependency management

匆匆过客 提交于 2020-01-03 13:39:49
问题 I am using a local maven repository to house some code I am using to develop a project. I have cited this repository in my project.clj file, and am now able to rely on local jars in this way (how to do this in a previous question of mine). Since I am actively developing these projects, I have my project.clj file looking for the LATEST version. But, in order to update a dependency, I still have to increment the version number of that dependency and then run lein install to build it to the