← Home

Dependency conflicts

Are you seeing an "Insufficient com.taoensso/encore version" exception while trying to start your Clojure/Script project that uses one of my open source libraries?

Then you’re very likely experiencing an Encore dependency conflict.

Encore is a common support library used by my other open source. If you use more than one of my libraries, it’s unfortunately possible that you’ll encounter this issue from time to time.

How to resolve

These instructions assume that you’re using Leiningen, but similar principles apply to other dependency management tools.

Step 1/3: identify the conflict

Run lein deps :tree to print a warning for possible dependency conflicts, e.g.:

Possibly confusing dependencies found:
[com.taoensso/tempura "1.5.2"] -> [com.taoensso/encore "3.30.0"]
 overrides
[com.taoensso/sente "1.19.1"] -> [com.taoensso/timbre "6.2.2"] -> [com.taoensso/encore "3.62.1"]
 and
[com.taoensso/sente "1.19.1"] -> [com.taoensso/encore "3.62.1"]

Step 2/3: resolve the conflict

A dependency conflict is normally caused by a situation like this in your project.clj:

:dependencies
  [[com.taoensso/tempura "1.5.2"]  ; Uses Encore 3.30.0 (OLD Encore)
   [com.taoensso/sente   "1.19.1"] ; Uses Encore 3.62.1 (NEW Encore)
   ]

I.e. our project uses 2 libraries, and those libraries each use a different version of Encore. So Leiningen isn’t certain which version of Encore to use for our project.

By default it will use the Encore version of whichever library is listed first.

But we actually want it to always use the newer Encore version.

There’s two methods to achieve this:

Method 1: reorder your dependencies

Reorder your dependencies so that the library using the latest version of Encore appears first:

:dependencies
  [[com.taoensso/sente   "1.19.1"] ; Uses Encore 3.62.1 (NEW Encore)
   [com.taoensso/tempura "1.5.2"]  ; Uses Encore 3.30.0 (OLD Encore)
   ]

Check your lein deps :tree output to see which library uses the newer version of Encore.

Method 2: include your own Encore dependency

Include your own Encore dependency before any other com.taoensso libraries:

:dependencies
  [[com.taoensso/encore  "3.62.1"] ; Above any other `com.taoensso` libraries
   [com.taoensso/tempura "1.5.2"]
   [com.taoensso/sente   "1.19.1"]
   ]

Note that with this method you will be responsible for ensuring that you always use the latest version of Encore! So if you do choose this method, consider also using lein-ancient or another method of keeping track of updated dependencies.

Step 3/3: confirm and clean

After updating any dependencies, it’s always a good idea to run:

  1. lein deps :tree again to confirm that all conflicts have been resolved.
  2. lein clean to remove any stale/broken Clojure/Script build artifacts.