Skip to content

Setting Clojure version

Sean Corfield edited this page Jul 13, 2016 · 14 revisions

There are two ways to set which Clojure version Boot is using:

  1. Globally using BOOT_CLOJURE_VERSION environment variable
  2. Per project using boot.properties file

This sets the Clojure version for core pod (build.boot context). It is used e.g. for REPL.

Additionally in your application you should also add a dependency to the same Clojure version. Otherwise it is possible that your dependencies have transitive dependency to Clojure causing that version to be used instead of one defined by BOOT_CLOJURE_VERSION for pods created by tasks.

(set-env!
  :dependencies [[org.clojure/clojure "1.7.0"]])

Libraries (including Boot tasks) shouldn't depend directly on a Clojure version. Instead, they should use :scope "provided" qualifier with a Clojure dependency. This qualifier makes the dependency non-transitive. Then the dependency works as a documentation about required Clojure version.

The earliest version of Clojure supported by Boot is 1.6.0.

Per project

You can create the boot.properties file using following command:

$ boot -V > boot.properties

And then editting the file to contain proper Clojure version:

#https://github.com/boot-clj/boot
#Sat Jun 13 17:56:35 EEST 2015
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.1.2

Note: When using boot.properties file you have to also pin the project to specific Boot version as the file must specify both variables.

Clone this wiki locally