任何方式添加依赖于lein项目没有REPL重新启动? [英] Any way to add dependency to lein project without REPL restart?

查看:306
本文介绍了任何方式添加依赖于lein项目没有REPL重新启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在做的是打开project.clj,添加依赖关系,运行 lein deps 重启repl,然后使用 require 等等。

What I do now is open project.clj, add dependency there, run lein deps restart repl, then use, require and so on.

事情是我真的不喜欢重新启动repl,因为启动时间慢,我必须重新加载我的文件。

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.

那么有更好的方法添加依赖项lein项目吗?无需重新启动复制?

So is there a better way to add dependency to lein project? without restarting the repl?

推荐答案

您可以使用 Alembic ,一个动态类路径加载器和依赖解析器。好的是它不加载所有的石榴依赖。

You can use Alembic, a dynamic classpath loader and dependencies resolver. The good thing is that it doesn't load all pomegranate dependencies.

将以下内容添加到您的 .lein / profile.clj

Add the following to your .lein/profile.clj:

{:user
  {:dependencies [[alembic "0.3.2"]]}}

然后在你的Repl中加载你需要的类路径,它们将被从仓库中拉出 lein 如果需要:

Then in your Repl just load the classpaths you need, they will be pulled from the repositories by leinif need:

(require 'alembic.still)
(alembic.still/distill '[enlive "1.1.5"])

(require'net.cgrand.enlive-html)现在应该可以工作了。

(require 'net.cgrand.enlive-html) should now work.

这篇关于任何方式添加依赖于lein项目没有REPL重新启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆