How do I install a leiningen plugin?
For example, leiningen-run?
I see this thing called "clojars.org", and how to "push" to it, but I don't see anything about "pulling" from it.
Leiningen is a modern build system for our Clojure projects. It's also written and configured entirely in Clojure. It works similarly to Maven, giving us a declarative configuration that describes our project, without needing to configure exact steps to be executed.
Most Clojure projects are still built using Leiningen.
The goal of the "deps" target is to ensure that every dependency required to run this project is available in your local maven repo. In short it populates ~/.m2/... with jars that need to be on the class-path for the project to run. If lein finds the dependency, which is the required version of a project, in ~/.
With Leiningen 2.0 and greater you specify which plugins you want as values to :plugins
in your project map. See the sample project.clj file. Note that "sample" is a bit of a misnomer, it's a reference for all possible (built-in) keys and documentation of their defaults.
The lein-run functionality is now part of core leiningen and doesn't need to be specified as a plugin
Clojars is a repository of clojure libraries quite similar to maven central (or to some lesser extent, rubygems). You don't pull from it explicitly. Instead, Leiningen is configured to search through a standard set of repos for your :dependencies
E.g. maven central and clojars. Maven uniquely identifies its dependencies (artifacts in maven parlance) by a triple (group-name, artifact-name, version)
. Leiningen leverages the exact same mechanism with the exception that the group name does not have the restriction of being a reverse URI the way it must be with maven central. In practice you'll tend to see many libraries published in clojars where the name nicely matches the clojure namespace and github project name without the annoying com.mydomain.awesomelib
You can set your own repos to be searched (or tweak various options) via :repositories
in you project.clj. You can similarly set :mirrors
if you have an in-house mirror of a maven repo.
Finally, though I don't think that's directly what you were asking but it's still interesting, If you're developing a plugin or what to depend on a plugin that hasn't been officially published, you can set :plugin-repositories
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With