polylith

Oliver Marks 2025-09-18T10:48:22.085739Z

Got a question about building uberjars for polylith projects, I currently have a build.clj at the root of the polylith project, I have been building with clojure -T:build uberjar :project $PROJECT how ever I have realised it uses the root deps.edn instead of the project deps.edn so it tries to pull in all components, I could put a build.clj in each project folder and build from there but that means maintaining a build.clj per projects. curious how other deal with this ?

furkan3ayraktar 2025-09-18T11:49:46.037359Z

Both the https://github.com/polyfy/polylith/blob/master/build.clj in the Polylith CLI repo and the https://github.com/furkan3ayraktar/clojure-polylith-realworld-example-app/blob/master/build.clj in the Realworld example project are located at the root, but they create uberjars for the projects using the project’s deps.edn. Are you trying to achieve something different?

Oliver Marks 2025-09-18T12:31:00.305539Z

I will check those out, thats what I am after but when I check the uberjar it seems to contain files from all projects not just the one I built, my assumption which could be wrong is because its using the root deps.edn file which has all the bases and components defined there but I will compare and check,

seancorfield 2025-09-18T16:40:42.900559Z

tools.deps and tools.build both have options to specify the root directory (`projects/<name>`) for operations. I created the original build.clj for Polylith itself, so feel free to ask me specific Qs. I can also share bits of how we do it at work -- where we have a 400+ line build.clj at the workspace root and build 20+ projects with it.