如何让 intellij 的 clojure 控制台加载 leiningen 中定义的依赖项?
我已经安装了“la Clojure”和“leiningen”插件。我创建了一个 clojure 项目并将 lib/ 文件夹添加为我的项目中的库。完成此操作后,编辑器了解这些库,如果我“运行”clojure 文件,它会成功加载依赖项,但如果我在 intellij 中启动控制台,它不会加载依赖项。如何让控制台加载它们?
I've installed the "la Clojure" and "leiningen" plugins. I've created a clojure project and added the lib/ folder as a library in my project. With this done the editor knows about the libraries and if I 'run' a clojure file it successfully loads the dependencies, but if I start a console within intellij it doesn't load the dependencies. How do I get the console to load them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我打开项目设置,添加 lib 和 lib/dev 作为 JAR 目录(IntelliJ 扫描它们以查找更改并自动更新类路径)。这适用于 Clojure 控制台。
I open the project settings, add lib and lib/dev as JAR directories (IntelliJ scans them for changes and updates the classpath automatically). This works with the Clojure console.
我会生成它,并让 idea 使用 Maven 来跟踪依赖项
如果 pom.xml 尚不存在,
I use
to generate pom.xml if it does not already exists and let idea to use maven to track the dependencies
我创建了一个 clojure 文件,它
需要
我的所有源文件。然后从 repl 屏幕我(加载“start-repl.clj”)
。由于手动步骤,这不是一个很好的解决方案,但它让我黑客攻击......I created a clojure file that
require
s all of my source files. then from the repl screen I(load "start-repl.clj")
. It's not a really good solution because of the manual steps but it gets me hacking...