leiningen

How do I use checked-in jars with leiningen

拜拜、爱过 提交于 2019-11-30 01:57:50
We have some 3rd-party jars checked-in to our project. We'd like to add them to the classpath. That's it. We don't want to set up a local maven repo (because that would break our 'check out and run' philosophy). Each developer would have to set up their own maven repo, distinct from the project. Is there a way to do this or is this? Most of the answers I've seen say to set up a local maven which we don't want or need just to add a jar to a classpath. You will need to setup a local maven repository, but that can be a simple directory, in your project directory, that you then check in to source

how to load ns by default when starting repl

筅森魡賤 提交于 2019-11-30 01:53:16
问题 I am using lein2. I would like to load some ns by default when the repl starts. Is it possible to either specify in project.clj the ns that should be loaded, when lein2 repl is executed for that project? 回答1: You will find a lot of answers in the sample project ;; Options to change the way the REPL behaves :repl-options {;; Specify the string to print when prompting for input. ;; defaults to something like (fn [ns] (str *ns* "=> ")) :prompt (fn [ns] (str "your command for <" ns ">, master? "

How to run .clj file as a script using leningen?

拟墨画扇 提交于 2019-11-29 22:53:57
This is the second question after Is there a standalone Clojure package within Leiningen? For example, I have a file hello_world.clj , and I can run it using java -cp clojure.jar clojure.main hello_world.clj . Since lein already contains Clojure (because I can run lein repl directly), is there a way to do the same thing like lein script hello_world.clj by lein? number23_cn use lein-exec plugin, example from readme.md (updated with "lein" instead of "lein2") cat foo.clj | lein exec lein exec -e '(println "foo" (+ 20 30))' lein exec -ep "(use 'foo.bar) (pprint (map baz (range 200)))" lein exec

Any way to add dependency to lein project without REPL restart?

China☆狼群 提交于 2019-11-29 20:15:13
What I do now is open project.clj, add dependency there, run lein deps restart repl, then use , require and so on. The thing is that I don't really like to restart repl because the startup time is slow and I have to reload my files again. So is there a better way to add dependency to lein project? without restarting the repl? i-blis You can use Alembic , a dynamic classpath loader and dependencies resolver. The good thing is that it doesn't load all pomegranate dependencies. Add the following to your .lein/profiles.clj : {:user {:dependencies [[alembic "0.3.2"]]}} Then in your Repl just load

How to change Clojure or Lein's Clojure default version?

。_饼干妹妹 提交于 2019-11-29 15:18:06
I'm not sure why but when I enter the REPL through $ clojure or $ lein repl , >(clojure-version) says '1.2.1'. I want it to say '1.5'. Version 1.5 works fine in my projects managed by lein. I just want to tell lein to always use 1.5 by default, instead of 1.2. Currently this isn't supported outside a project, but it's being worked on: https://github.com/technomancy/leiningen/issues/966 A workaround for now is just to specify it in your project.clj Further recommendation: upgrade to Leiningen 2.0. 来源: https://stackoverflow.com/questions/15170388/how-to-change-clojure-or-leins-clojure-default

Could not locate clojure/core/async__init.class or clojure/core/async.clj on classpath

微笑、不失礼 提交于 2019-11-29 10:02:37
Does anyone know why I'm getting the below error? I read through answers of similar questions, which recommended using Leiningen, which I've done below and still get the error. MacBook-Pro:~ xxx$ lein new app test Generating a project called test based on the 'app' template. MacBook-Pro:~ xxx$ cd test MacBook-Pro:test xxx$ lein repl nREPL server started on port 59623 on host 127.0.0.1 REPL-y 0.2.1 Clojure 1.5.1 Docs: (doc function-name-here) (find-doc "part-of-name-here") Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit)

How to access values on leiningen profiles?

放肆的年华 提交于 2019-11-29 08:15:02
问题 I've got a two profiles defined in project.clj, one locally, one for testing on travis: :profiles {:dev {:dependencies [[midje "1.6.0"] [mysql/mysql-connector-java "5.1.25"]] :plugins [[lein-midje "3.1.3"]] :user "root" :pass "root"} :travis {:user "travis" :pass ""}} I'm hoping to be able to get access to the :user and :pass values in my projects. How can this be done? Update: I also want to be able to use the lein with-profile command... so my tests would have: lein with-profile dev test ->

How to use leiningen to develop using local jars?

早过忘川 提交于 2019-11-29 06:40:58
I realize that this question is pretty much the exact question found here . However, seeing as that question is 1.5 years old (or so), I would like to revisit it. How does one add local dependencies using leiningen? Surely this capability must exist by now? Create a private Maven Repository , and then, add the following to your project.clj :repositories {"local" ~(str (.toURI (java.io.File. "your_local_repository")))} If the jars are based on your own projects, you can use lein install to put them into your local .m2, or use the checkout-dependencies feature. You can also use the extra

Embed version string from leiningen project in application

不羁的心 提交于 2019-11-29 03:55:15
I want to be able to query or embed the version string set by the leiningen project and display that value to user. Uses include displaying the version string from the CLI, or as a header in a ring application. Is this possible? If you're running inside Leiningen using lein run or the like, it's available as a system property: (System/getProperty "myproject.version") . If you're producing a jar you need to read pom.properties . I like technomancy's answer, but I had to go look up how to "read pom.properties ". It turns out that for the maven artifact com.example/my-project, there is a file on

Dependencies in maven local repositories with leiningen

Deadly 提交于 2019-11-29 03:35:13
问题 I am starting lein new project in clojure and want to use the goose article extraction library. Unfortunately I couldn't find the jar of that library on any publicly available maven repository, so I set out to add it to a local maven repository. In the project directory, I copied the goose jar and its pom.xml files and did mkdir maven-repo mvn install:install-file -Dfile=goose-2.1.6.jar -DartifactId=goose -Dversion=2.1.6 \ -DgroupId=local -Dpackaging=jar -DlocalRepositoryPath=maven-repo