CLI tools make Clojure very accessible and simple to install as they are a essentially a wrapper for running Clojure code using the
java command and use additional libraries to manage dependencies, class paths, create projects and build java archive (jar) files.
Its quite common to use the
java command to run your code in production, usually defined in a shell script. Leiningen can be used to run your application in production too, however, because Leiningen creates 2 JVM instances (one for itself and one for the application), its more efficient to just use the
Leiningen does provides a very rich set of templates that speed up development with Clojure and has a multitude of plugins. Plugins provide a rich source of features but they are not very composable, especially compared to the Clojure language itself.
Clojure CLI tools provide a minimal but elegant layer on top of the
java command and enables libraries, configuration and code to compose together just like Clojure functions. So we will continuing the exploration of Clojure CLI tools and dig a little deeper under the covers to understand how they work and how to configure projects to be very flexible, especially the different sources of code you can use .
This article follows on from getting started with Clojure CLI tools