I’ve migrated a few projects from lein to tools.deps and explored different approaches to building uberjars. For the time being, I am using uberdeps.
One issue I have was that even though the clojure CLI already generates a nice classpath for you and the ability to merge in extra paths and dependencies, existing packaging tools require you to use a different syntax to configure the same options. This is because the dependency on the tool itself impacts the clojure-generated classpath and will end up impacting the output.
I was interested in whether we could create an uberjar using just the clojure cli and java tooling, without depending on external packages, and have managed to come up with a few scripts that I’ve put in a gist:
Ultimately, it depends on the clojure generated classpath directly, optionally adds maven pom.xml details from your project into the META-INF, and uses the jar tool with its various options to create a runnable jar with a manifest.
Have a look, try it out, and mix and match it into your build scripts if you like.