depstar

Discussion around https://github.com/seancorfield/depstar
maxp 2020-12-29T06:45:06.330Z

Thank you, depstar now works great.

maxp 2020-12-29T06:49:35.332400Z

some of my thoughts about pom.xml: • IDEs recognize folders with pom.xml as Java project and offer 'add java support' • it is not so good when build process touches git indexed files • two separate lists of dependencies in source tree (deps.edn / pom.xml)

seancorfield 2020-12-29T17:04:53.339200Z

@maxp The problem -- for libraries, at least -- is that pom.xml is needed for deployment and contains information that other tooling needs beyond just group/artifact/version and dependencies (which is the bare minimum that clojure -Spom -- or depstar :sync-pom true -- will generate). http://cljdoc.org, for example, uses information from the pom.xml file to populate stuff in the generated docs (all the SCM information). Even Clojars relies on some of that SCM information. The POM is also used to determine (transitive) dependencies when someone else depends on your library JAR. So there's information that has to be in the pom.xml file that cannot be generated (as much as clj-new tries to generate a "full-size" pom.xml when you create a new project -- by making a lot of assumptions about SCM and developers and so on). And if that information cannot be generated -- and may need to be maintained by hand (such as adding/changing developers or updating SCM if the project is moved from GitHub to GitLab, for example) -- then that information must be under version control.

seancorfield 2020-12-29T17:08:29.342500Z

I don't care much about the IDE problem (the vast majority of Clojure developers do not use such an IDE and even for those who do, it is only going to ask once per project right?). I agree that it is frustrating that pom.xml contains information that has to be versioned but that's the world we live in as Clojure developers, and also that it is redundant for dependencies to be in two files but that's why clojure -Spom exists (and why depstar can now do that automatically for you: I've added :sync-pom true to the :exec-args in some of my projects already).

seancorfield 2020-12-29T17:09:19.343400Z

For library (thin) JARs, depstar already treats the pom.xml as optional but makes it easy to create/maintain it automatically if you wish.

seancorfield 2020-12-29T17:15:21.344600Z

For standalone (uber) JARs, I agree that depstar is too aggressive and could certainly build a .jar file that responds to java -jar without a pom.xml file. https://github.com/seancorfield/depstar/issues/59