Keeping dependency versions up to date in Leiningen projects
Asked Answered
R

4

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.

Rosenkranz answered 17/4, 2011 at 12:55 Comment(0)
T
9

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.

Thomson answered 17/4, 2011 at 13:28 Comment(1)
Last commit on that plugin is 9 Years ago! This project is dead.Gomulka
R
30

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". :)

Rearrange answered 7/7, 2013 at 16:29 Comment(0)
T
9

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.

Thomson answered 17/4, 2011 at 13:28 Comment(1)
Last commit on that plugin is 9 Years ago! This project is dead.Gomulka
W
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.

Wiatt answered 18/4, 2011 at 3:30 Comment(5)
OK, so Maven implements similar functionality to Ivy in this respect. That's cool. How do I get at it from Leiningen?Rosenkranz
@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"]]Wiatt
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.Wiatt
Agreed. It's just for DEV. CI and higher envs should use exact dependencies.Rosenkranz
It appears tha leiningen no longer supports the use of "LATEST" as a version number.Bagdad
T
0

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

http://clj-deps.herokuapp.com

Disclaimer, by me.

Threesquare answered 8/7, 2013 at 7:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.