24

Is there a simple way to find out what versions of dependencies are available using Leiningen?

E.g., if I have a web app which depends on Hiccup and Compojure, how can I be sure that I'm on the latest version of each without going to the github page for each?

NOTE: I use Ant and Ivy for building my Java projects, so I have limited knowledge of Maven - so please spell out (or provide Fine Links for me to read) any Maven concepts that Leiningen exposes to me which would help with this (I know that under the hood, Leiningen uses Maven for dependency resolution). Ta.

kittylyst
  • 5,640
  • 2
  • 23
  • 36

4 Answers4

31

The Clojure ecosystem has evolved since the original answer was offered. At the present time, I would recommend using lein-ancient:

A Leiningen plugin to check your project for outdated dependencies and plugins. This plugin supersedes lein-outdated and uses metadata XML files in the different Maven repositories instead of a Lucene-based search index. Version comparison is done using version-clj.

Its precursor, lein-outdated, has this helpful message in its README: "lein-outdated is outdated". :)

David J.
  • 31,569
  • 22
  • 122
  • 174
10

The canonical way of doing this, at least for dependencies kept in clojars, is the lein-search plugin.

Update: See the highest-rated answer below for a more up-to-date response.

sanityinc
  • 15,002
  • 2
  • 49
  • 43
8

You should have a look at the answer to this question. Leiningen uses the same versioning mechanism as maven so, for example, if you want to use the latest version of a given library, you can substitute the word "LATEST" for the version number. You can also specify a release version or a version range. Again, look at the answer at that link.

Community
  • 1
  • 1
stand
  • 3,054
  • 1
  • 24
  • 27
  • OK, so Maven implements similar functionality to Ivy in this respect. That's cool. How do I get at it from Leiningen? – kittylyst Apr 18 '11 at 09:31
  • @kittylyst: You just need to replace the dependency version string in your project.clj file. So, for instance, instead of `:dependencies [[compojure "0.4.0"]]` you might say `:dependencies [[compojure "LATEST"]]` – stand Apr 18 '11 at 15:01
  • 1
    I suppose I should also warn that by not specifying an exact version of each of your dependencies, you introduce some non-determinacy into your project. It's probably best to settle on exact versions for released software, but for development it should be fine. – stand Apr 18 '11 at 15:06
  • Agreed. It's just for DEV. CI and higher envs should use exact dependencies. – kittylyst Apr 18 '11 at 16:52
  • It appears tha leiningen no longer supports the use of "LATEST" as a version number. – Alan Thompson Aug 05 '14 at 23:15
0

Web service that provides this info, along with badges for readmes.

http://clj-deps.herokuapp.com

Disclaimer, by me.

rodnaph
  • 1,237
  • 10
  • 12