15 November 2020

Clojre: What Is deps.edn?

You may have seen there are two common ways to run a clojure app: boot and leningen.

But there's a third, simpler way. Just use clojure's built in tools.

Clojure Tools

If you only need simple dependency management and the ability to run a command from the CLI then clojure has you covered.

To get started you need to create a deps.edn file with your dependencies listed like so:

{:deps
 {clj-http {:mvn/version "3.11.0"}}}

Create your first src file in, say, src/hello, and you're good to go.

When you need to run it you can run your command by specifying the namespace and the function name like this:

sh clj -X -main example/-main

See the sample repo for a really minimal example.

Tags: clojure boot leningen deps