Index of all namespaces
A leiningen plugin to find classpath collisions
A Leiningen plugin to find conflicting files on the classpath.
Classpath conflicts are bad, because there is no good way to define the classpath order in a dependency tree, so the classpath ordering is essantially random. Having different versions of a library on the classpath can create pretty appalling heisenbugs. This plugin helps find the sources of such deployment issues.
Example output for a project with collisions in
Comparison / Examples
This is not to be confused with the
:pedantic flag in leiningen.
:pedantic catches cases, where transitive dependencies would be pulled in with different versions, e.g. (ring/ring-core “1.1.0” vs “1.2.0”)
lein-collisions is complementary: It catches cases, where different artefacts provide the same classes or resources. An example is
org.clojure/tools.reader. Another increasingly common case is the resource
data_readers.clj being defined by multiple libraries.
Library repackages like the
tools.reader example are especially problematic, because of the following, typical scenario:
Program fails because of an outdated
tools.reader version. You think “strange, why is the library pulling an old version”, but insert the most recent version anyway. It still fails. You randomly tweak dependencies, suddenly it works (because the classpath order changed), until it doesn’t (most often in production). The actual problem has been the whole time that
ibdknox/tools.reader provides classes resources in
clojure/tools/reader*, but it’s very hard to discovery this.
garden (the css library) depends on
yuicompressor, which repackages (not depends on) an old version of
rhino. You eventually will run into bugs relating to old rhino versions, only it will take you a long time to figure it out, because you’ll be pretty sure to depend on the most recent version.
lein-collisions helps you to find out about this and take measures before problems show up.
Copyright © 2015 Herwig Hochleitner
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.