leiningen

How do you configure proprietary dependencies for Leiningen?

浪子不回头ぞ 提交于 2019-12-03 15:39:09
We're working on a project that has some Clojure-Java interop. At this point we have a single class that has a variety of dependencies which we put into a user library in Eclipse for development, but of course that doesn't help when using Leiningen (2.x). Most of our dependencies are proprietary, so they aren't on a repository somewhere. What is the easiest/right way to do this? I've seen leiningen - how to add dependencies for local jars? , but it appears to be out of date? Update: So I made a local maven repository for my jar following these instructions and the lein deployment docs on

Scripting with Clojure

最后都变了- 提交于 2019-12-03 14:47:27
I was trying to do some simple scripting work with Clojure. For example, I would load a json which contains a map from a file, remove a given key, and save it back to the file. With leiningen, seems I would have to create an app, add data.json or whatever into the dependencies, then I could start a lein repl to do the real work. Think about doing the same thing with Python. It should be done with 3 lines of code in Python. Is there an easy way to do it with leiningen? You can try out the lein-oneoff plugin which was made for situations like these (I'm the author). It lets you declare

How do you change Clojure version in Leiningen and LightTable?

我与影子孤独终老i 提交于 2019-12-03 11:43:05
When I type (clojure-version) into my repl in LightTable, I get "1.5.1" as output. Is there any way to upgrade to 1.6.0? I am assuming that it is drawing the Clojure version from Leiningen (2.3.4 on my machine), which is stocked with 1.5.1 out of the box. How can I make sure that both Leiningen and LightTable are using the most recent version of Clojure? I have googled around and can't find any clear answers. I did find this SO question , but it didn't address my problem specifically. Is there like a "lein update" command I can call that automates this process, and which LightTable will

Can you have leiningen load library code from locally checked out source?

浪尽此生 提交于 2019-12-03 11:41:17
Let's say I was hacking on a clojure library I was using in my project: /User/SCdF/Code/myproject/ /User/SCdF/Code/other-peoples-projects/clojure-library-cloned-from-github Currently, when I make changes in clojure-library-cloned-from-github I then run lein install to push my new version to the local repository (I've changed my and their project.clj to point to a newer -SNAPSHOT version of the library so it gets updated every time) and then restart / run lein deps on myproject . Is there a way I can tell leiningen to look in ../../clojure-library-cloned-from-github for the source code for the

Does Leiningen read maven settings in .m2/settings.xml?

ε祈祈猫儿з 提交于 2019-12-03 11:39:10
I have several additional repositories in ~/.m2/settings.xml . I tried lein search and it doesn't find the packages in my repositories. How can I tell leiningen to search repositories in maven settings? You can add the :repositories tag to your project.clj file: (defproject com.foo/bar "1.0.0-SNAPSHOT" ;; ...other configuration... :repositories [["java.net" "http://download.java.net/maven/2"]]) Take a look at the official sample project.clj . You'll have to copy over the repository configuration from your settings.xml file, but this is the idiomatic and recommended way to manage repositories

Project-level Leiningen Plugin

只谈情不闲聊 提交于 2019-12-03 11:29:46
In Leiningen versions 1.x.x I was able to define a lein foo task valid only in a single project by putting the following in that project's project.clj : (defproject tester "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.4.0"]]) ;; Create a task, "foo" (ns leiningen.foo (:require (leiningen [uberjar :as uberjar]))) (defn foo [project & args] (println "Do something here first, then make the uberjar.") (uberjar/uberjar project))

leiningen: missing super-pom

无人久伴 提交于 2019-12-03 10:56:16
if I enable eith the clojure-couchdb or swank-clojure then lein deps fails because org.apache.maven:super-pom:jar:2.0 is missing :dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"] [org.clojure/clojure-contrib "1.0-SNAPSHOT"] [clojure-http-client "1.0.0-SNAPSHOT"] [org.apache.activemq/activemq-core "5.3.0"] ; [org.clojars.the-kenny/clojure-couchdb "0.1.3"] ; [org.clojure/swank-clojure "1.1.0"] ]) this error: Path to dependency: 1) org.apache.maven:super-pom:jar:2.0 2) org.clojure:swank-clojure:jar:1.1.0 ---------- 1 required artifact is missing. for artifact: org.apache.maven:super

How to run the jar made from 'lein jar' command?

与世无争的帅哥 提交于 2019-12-03 10:49:37
This is a follow-up for this question . After running 'lein jar', I get 'myproject-1.0.0-SNAPSHOT.jar', which doesn't contain the clojure-1.2.0-beta1.jar and clojure-contrib-1.2.0-beta1.jar. And running 'lein uberjar' gives me two jar files. The first one (that ends with -standalone.jar) is the jar contains everything, and the second one is the same as the jar generated with 'lein jar'. This is the question of the jar with the second one. There's no problem running with the first jar, as I explained in the previous post . When I run java -cp PATH_TO_THE_CLOJURE_AND_CONTRIB.jar:$CLASSPATH -jar

clojure/ring/jetty: I am using > lein ring server. How do I configure the jetty instance that gets instantiated?

夙愿已清 提交于 2019-12-03 10:29:15
问题 When I was calling the jetty handler directly, I was able to pass in a configurator like so: (def header-buffer-size 8388608) (defn start [port] (ring/run-jetty (var app) {:port port :join? false :host "127.0.0.1" :configurator (fn [jetty] (doseq [connector (.getConnectors jetty)] (.setHeaderBufferSize connector header-buffer-size)))})) I had to do this because I kept getting a FULL HEAD error when posting. Now I refactored things to use > lein ring server directly, which gets called from the

Deploying Clojure apps with Leiningen

会有一股神秘感。 提交于 2019-12-03 08:53:50
问题 This is my project.clj file so far: (defproject raj "0.0.1-SNAPSHOT" :description "FIXME: write description" :dependencies [[org.clojure/clojure "1.3.0"]] :keep-non-project-classes true :main raj.core) And my core.clj file: (ns raj.core (:use raj.core)) (defn -main [& args] (println "Hello World!!!")) lein run -m raj.core displays the Hello World message just fine. So next I try lein uberjar and get Compiling raj.core Compilation succeeded. Created C:\Users\bobjones\IdeaProjects\raj/raj-0.0.1