user1311390
user1311390

Reputation:

Clojure: is there a way to load leiningen plugins as libraries?

Question:

Is there a way to load a lein plugin, say codex or lein-beanstalk, as a clojure library ?

Context:

I'm writing some tools for managing my lein projects, and I keep finding myself wanting to have the functionality of lein plugins as libraries in my code -- but I don't see a way to access the lein-pluins namespaces from clojure user land.

EDIT:

In particular, I want to use: https://github.com/weavejester/codox

I want to be able to do the equiv of "lein doc" but from inside of a "lein repl."

The problem is that I can't load the codox.codox.core namespace.

Thanks!

Upvotes: 2

Views: 520

Answers (1)

Vladimir Matveev
Vladimir Matveev

Reputation: 127791

Of course you can do it. Leiningen plugins are plain maven artifacts. All you need to do is to specify your plugin in :dependencies clause in project.clj, like this:

   :dependencies [[org.clojure/clojure "1.3.0"]
                  [lein-beanstalk "0.2.2"]]

Then run lein deps and Leiningen will download needed plugin into your lib directory.

Upvotes: 2

Related Questions