r/Clojure • u/teobin • May 27 '25
[Q&A] Project details for deps.edn
What is the custom way to specify project name, version, description, license, etc. For a clojure project managed by deps.edn?
Maybe my question is out of place or I'm missing something, if so please, let me know. But I understand that lein has project.clj for this so, I'd like to know if there is an idiomatic or customary way to do it with clj cli.
10
Upvotes
3
u/v4ss42 May 27 '25
Those are typically achieved using tools.build, rather than tools.deps (which is where deps.edn files come from).
I think it helps to think of tools.deps / deps.edn as simply a way to declare a bag of classpaths in a simple configuration file, while tools.build is a library of build-oriented functions for the domain of building software (and it happens to itself depend upon tools.deps).
3
u/lgstein May 27 '25
deps is not a build tool, so it doesn't care about this data. tools.build https://clojure.org/guides/tools_build lets you put this data in your build.clj. Nothing prevents you from putting it in your deps.edn, though. Its just a map. You can the pick it up in your build pipeline or whatever purpose you have in mind.
7
u/seancorfield May 27 '25
As the author of a
tools.buildwrapper that I have since deprecated, my feeling is that some of these small conveniences are not worth dragging in a dependency for, especially since most projects tend to be slightly different.I also wrote (and have deprecated)
depstarwhich was a library to build JAR files, wrappingtools.deps(then.alphaback then). I deprecated it whentools.buildappeared since it provides a flexible, programmable API, and any wrapper is either going to be very restrictive or have to expose an equivalent API somehow.clojure.ednandslurpare both "built-in" so loading and parsing that information from an EDN file is two function calls -- not worth a library. In addition, I think pretty much everyone just declares their lib/version/etc as top-leveldefforms inbuild.clj.