如何安装leiningen插件? [英] How to install a leiningen plugin?

查看:253
本文介绍了如何安装leiningen插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何安装leiningen插件?

How do I install a leiningen plugin?

例如,leiningen-run?

For example, leiningen-run?

这个东西叫做clojars.org,以及如何推送它,但是我没有看到任何关于pull的东西。

I see this thing called "clojars.org", and how to "push" to it, but I don't see anything about "pulling" from it.

推荐答案

如果一个插件在Clojars可用,像lein run是,只需将它添加到项目的:dev-dependencies in project.clj, >在项目目录中使用 lein deps 让Leiningen在所有依赖关系中拉取。来自lein run的文档的注释摘录:

If a plugin's available at Clojars, like lein run is, just add it to your project's :dev-dependencies in project.clj, then say lein deps in your project's directory to have Leiningen pull in all dependencies. An annotated excerpt from lein run's docs:

(defproject island-wari "0.1"
  :description "Web application for playing the Island Wari game."
  :main wari
  :dependencies     [[org.clojure/clojure "1.1.0-master-SNAPSHOT"]
                     [org.clojure/clojure-contrib "1.1.0-master-SNAPSHOT"]
                     [org.clojars.liebke/compojure "0.3.1-master"]]
  :dev-dependencies [[org.clojure/swank-clojure "1.0"]
                     [leiningen-run "0.2"]]) ; <--- this bit makes it possible
                                             ;      to use lein run

完成上述操作后,您应该能够说

Having done the above, you should be able to say lein run in your project's directory to run your app.

更新:如果您想为Leiningen编写自己的插件,请查看本教程在nakkaya.com 。即使你不打算写lein插件,仍然查看那个博客,它绝对积极的岩石。

Update: Should you want to write your own plugins for Leiningen, check out this tutorial on nakkaya.com. Even if you're not planning on writing lein plugins, still check out that blog, it absolutely positively rocks.

这篇关于如何安装leiningen插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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