clojureproperties-fileboot-clj

What information is required in boot.properties?


I want to specify the Clojure version for my project that uses Boot. According to the Boot Wiki, the way to do this is by providing a value for BOOT_CLOJURE_VERSION in a boot.properties file in my project root. So I did that:

$ cat boot.properties
BOOT_CLOJURE_VERSION=1.7.0

It seems to work just fine:

$ tail -2 ~/.boot/boot.properties
BOOT_VERSION=2.5.5
BOOT_CLOJURE_VERSION=1.8.0
$ cat build.boot
(deftask version []
  (println "Clojure" (clojure-version))
  (println "Boot core" *boot-version*)
  (println "Boot app" *app-version*))
$ boot version
Clojure 1.7.0
Boot core 2.5.5
Boot app 2.5.5

However, that same wiki page specifically says to create the boot.properties file like this:

$ boot -V > boot.properties

This adds two lines at the beginning, which look like comments to me, and one at the end that specifies the Boot version. I have no problem with specifying the Boot version for my project, but the wiki page makes it sound as if it's required:

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

I'm a bit confused about why the page specifically says to add these three lines to boot.properties when omitting them doesn't seem to cause any problems. Additionally, if I'm using revision control, I see no need to put a timestamp in boot.properties. Is it OK to omit these lines? If not, why are they needed?


Solution

  • This is most likely a case of outdated wiki information. From the source:

    // BOOT_VERSION is decided by the loader; it will respect the
    // boot.properties files, env vars, system properties, etc.
    // or it will use the latest installed version.
    

    I guess you could consider it good practice to lock both the Clojure and Boot version per project as this will prevent any future problems that may arise from incompatible versions.

    The 2 comment lines added by Boot are just for information purposes and can be safely omitted.