depstar

Discussion around https://github.com/seancorfield/depstar
maxp 2020-12-28T02:45:28.316800Z

pom.xml really needed for library jars, right?

maxp 2020-12-28T02:46:17.317400Z

but can be omitted when building "single file executable" uberjar?

seancorfield 2020-12-28T17:09:25.319500Z

@maxp Yes, if you're publishing a (library) JAR to Clojars or Maven Central, you need a pom.xml file that is deployed alongside the JAR (technically, the process could just look in the JAR file for a suitable pom.xml but I believe deployment would still need to know the group/artifact IDs -- which it can read easily from a pom.xml file!). But the pom.xml file can be entirely external to the JAR-building process since deployment only needs the JAR and the pom.xml file -- so building a library JAR doesn't require a pom.xml file but deploying it does.

seancorfield 2020-12-28T17:19:05.325100Z

If you're building a standalone (uber) JAR then you don't really need a pom.xml file. depstar can build uberjars without any additional information, that you can execute with java -cp path/to/the.jar clojure.main -m my.entry.point

seancorfield 2020-12-28T17:29:07.326800Z

Given a MANIFEST.MF file, specifying Main-Class: clojure.main you can just do java -jar path/to/the.jar -m my.entry.point (because it executes clojure.main/-main automatically).

seancorfield 2020-12-28T17:52:27.328800Z

I'm planning to refactor/cleanup the code quite a bit "soon" and then I'll rethink how a lot of the pom-related stuff needs to work. In theory, you could just provide the information depstar needs via command-line arguments and it wouldn't need a pom.xml for anything (but it's still "good practice" to have one or generate one).