Lein: init response options

According to https://github.com/technomancy/leiningen/blob/master/sample.project.clj I can connect: init inside the parameters: repl-options.

However, when I try:

lein version; echo "====="; cat project.clj; echo "====="; lein repl 

I get the output:

 Leiningen 1.7.1 on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM ===== (defproject test "0.0.1" :dependencies [[org.clojure/clojure "1.3.0"]] :source-paths ["src"] :jvm-opts ["-Xms4g" "-Xmx4g"] :repl-options { :init (println "Init") } ) ===== Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at jline.ConsoleRunner.main(ConsoleRunner.java:69) Caused by: java.lang.IllegalArgumentException: No value supplied for key: [:init (println "Init")] (NO_SOURCE_FILE:0) at clojure.lang.Compiler.eval(Compiler.java:5440) at clojure.lang.Compiler.eval(Compiler.java:5391) at clojure.core$eval.invoke(core.clj:2382) at clojure.main$eval_opt.invoke(main.clj:235) at clojure.main$initialize.invoke(main.clj:254) at clojure.main$script_opt.invoke(main.clj:270) at clojure.main$main.doInvoke(main.clj:354) at clojure.lang.RestFn.invoke(RestFn.java:457) at clojure.lang.Var.invoke(Var.java:377) at clojure.lang.AFn.applyToHelper(AFn.java:172) at clojure.lang.Var.applyTo(Var.java:482) at clojure.main.main(main.java:37) ... 5 more Caused by: java.lang.IllegalArgumentException: No value supplied for key: [:init (println "Init")] at clojure.lang.PersistentHashMap.createWithCheck(PersistentHashMap.java:89) at clojure.core$hash_map.doInvoke(core.clj:327) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:540) at leiningen.repl$repl_options.invoke(repl.clj:16) at leiningen.repl$repl_server.doInvoke(repl.clj:69) at clojure.lang.RestFn.applyTo(RestFn.java:146) at clojure.core$apply.invoke(core.clj:546) at leiningen.repl$repl.invoke(repl.clj:145) at clojure.lang.Var.invoke(Var.java:365) at clojure.lang.AFn.applyToHelper(AFn.java:161) at clojure.lang.Var.applyTo(Var.java:482) at clojure.core$apply.invoke(core.clj:542) at leiningen.core$apply_task.invoke(core.clj:262) at leiningen.core$_main.doInvoke(core.clj:329) at clojure.lang.RestFn.invoke(RestFn.java:410) at clojure.lang.AFn.applyToHelper(AFn.java:161) at clojure.lang.RestFn.applyTo(RestFn.java:132) at clojure.core$apply.invoke(core.clj:542) at leiningen.core$_main.invoke(core.clj:332) at user$eval47.invoke(NO_SOURCE_FILE:1) at clojure.lang.Compiler.eval(Compiler.java:5424) ... 16 more 

What am I doing wrong?

In particular, I do not understand why [: init + func +] is treated as a key, and not: init is treated as a key.

Thanks!

+4
source share
1 answer

Not sure, but the link you gave tells the master that Leiningen 2 is probably not the same as the stable branch, which is probably 1.7-ish? If you switch the branch to stable via your github link, there is no parameter: init ...

+3
source

Source: https://habr.com/ru/post/1411653/


All Articles