Skip to content

Instantly share code, notes, and snippets.

@wdhowe
Last active February 3, 2024 21:09
Show Gist options
  • Save wdhowe/a7df51d5ad2e7f969d78a3bc395f8a88 to your computer and use it in GitHub Desktop.
Save wdhowe/a7df51d5ad2e7f969d78a3bc395f8a88 to your computer and use it in GitHub Desktop.
Installing plugins for Clojure's Leiningen

Leiningen Plugins

Lein can be extended via plugins.

Some useful plugins are:

  • lein-ancient -> Check your project for outdated dependencies and plugins, as well as upgrade them if desired.
  • lein-exec -> Allows single clojure files to be executed and their requirements resolved.
  • lein-localrepo -> Work with local Maven repository.
  • lein-pprint -> Pretty-print a representation of the project map.
  • lein-zprint -> Pretty format a clojure source file.

Plugins can be added to the 'plugins' vector of:

  • ~/.lein/profiles.clj -> cross project profiles for plugins
  • A lein project's project.clj -> project specific plugins

profiles.clj example:

{:user {:plugins [[lein-ancient "1.0.0-RC3"]
                  [lein-exec "0.3.7"]
                  [lein-localrepo "0.5.4"]
                  [lein-pprint "1.3.2"]
                  [lein-zprint "1.2.8"]]}}

project.clj example:

(defproject myproject "0.1.0"
;; description, url, license, dependencies, profiles, etc
:plugins [[lein-ancient "1.0.0-RC3"]])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment