I want to build an uberjar for use with DATOMIC_EXT_CLASSPATH , to be loaded by the Datomic transactor. I want it to be an uberjar because there are some dependencies I want to include. I don't want to include Clojure and the Datomic peer library in the uberjar, because they will already be present on the transactor's classpath. But I need Clojure and Datomic present at build time. What's the best way to achieve this with tools.build?
this is a little challenging depending on the transitive dependency set of both Datomic peers and your code and whether they overlap
do they?
Looking at the deps tree, it appears that they do not.
The Datomic stuff is pretty easily handled if you:
1. create a basis with all deps and AOT compile to a classes directory
2. uber with :class-dir classes and :exclude ["com.datomic.*"] I think (maybe there are other patterns needed)
might be easier to make a second basis and pull the datomic libs from the :deps instead of the :exclude, not sure
there is not an easy way to omit Clojure itself from the uber jar though
I am misremembering how :exclude works, it's not lib-based, it's path-based, so you could use it to remove both datomic and clojure stuff like
:exclude ["com/datomic/.*" "org/clojure/.*"]
Thanks, Alex. This would still require step 1 above, right? ("create a basis with all deps and AOT compile to a classes directory*")*
yep