How to declare a super specific version of Clojure in the deps.edn?

Clojure CLI versions are not Clojure versions. See https://clojure.org/releases/tools for Clojure CLI versions.

The Clojure CLI can use any version of Clojure: you specify org.clojure/clojure as a dependency and you can even use Clojure 1.0 with the latest Clojure CLI:

(! 622)-> clojure -Sdescribe
{:version "1.10.1.727" <==== THIS IS THE CLOJURE CLI VERSION
 :config-files ["/usr/local/Cellar/clojure@1.10.1.727/1.10.1.727/deps.edn" "/Users/sean/.clojure/deps.edn" "deps.edn" ]
 :config-user "/Users/sean/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/Cellar/clojure@1.10.1.727/1.10.1.727"
 :config-dir "/Users/sean/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}

Tue Oct 27 11:23:56
(sean)-(jobs:0)-(~/clojure)
(! 623)-> clojure -A:1.0 <==== THIS IS AN ALIAS FOR org.clojure/clojure {:mvn/version "1.0.0"}
Downloading: org/clojure/clojure/1.0.0/clojure-1.0.0.pom from central
Downloading: org/clojure/clojure/1.0.0/clojure-1.0.0.jar from central
Clojure 1.0.0-
user=> (clojure-version)
"1.0.0-"
user=> *clojure-version*
{:major 1, :minor 0, :incremental 0, :qualifier ""}
user=> 

You can install a specific version of the Clojure CLI. I use brew on macOS and Linux, for example:

brew install clojure/tools/clojure@1.10.1.727

Several projects out there now rely on the changed -M behavior or the new -X option on the CLI, which is why they say you need at least 1.10.1.697.

2 Likes