我已经安装了 clojure-1.4.0 和 clojure-1.5.0 并且工作正常。在我的各种 project.clj 文件中,我可以将一个或另一个设置为依赖项,并且 leiningen 会正确选择指定的版本。当我不在项目目录中时,lein repl
总是运行 clojure-1.4.0。我试图通过将以下内容profiles.clj
放在我的~/.lein
目录中来更改默认值:
{:user {:dependencies ^:replace [[org.clojure/clojure "1.5.0"]]
:plugins [[lein-pprint "1.1.1"]]}}
但是lein repl
,当不在项目目录中时,仍然运行 clojure-1.4.0,如果我碰巧lein repl
在~/.lein
目录中运行,则会出现看似不正确的错误消息:
WARNING: user-level profile defined in project files.
我知道我的 project.clj 文件中没有用户配置文件,因为以下命令不打印任何内容
find ~ -name project.clj -exec grep ":user" "{}" ';' -print 2> /dev/null
我知道 leiningen 正在读取我的 profiles.clj 文件,因为如果我在文件中故意放置语法错误,我会得到预期的编译器异常。
我已经阅读lein help profiles
但不能完全弄清楚我做错了什么。
提示,请&谢谢?