Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

This is a feature request rather than a bug question.

I was just working on self-executable jars, and it would be very handy to put something into the manifest for clojure.main to know what to do on startup, similarly to how the jvm does with the main class. This would save me the trouble of needing to perform AOT to make a release to production.

Main-Class: clojure.main Main-Namespace: my.cool.ns

1 Answer

+1 vote

It's an interesting idea. I think one potential issue is knowing which manifest file to read. I guess in the case of a self executable jar file there is only one so you could just read the META-INF/MANIFEST.MF resource. Seems like there's no reason to then tie it up into the weird manifest format, could just as easily read a well known exec.edn or whatever and could work for not just executable jars but any setup. Certainly something to think about.

I'm not married to MANIFEST.MF, although it's quite easy with tools.build to add in `{"Main-Namespace" "my.cool.ns"}` rather than fiddle with an extra file.