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 ?
there are some ideas in this thread https://clojurians.slack.com/archives/C013B7MQHJQ/p1732788192845909?thread_ts=1732784467.644809&cid=C013B7MQHJQ
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?
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,
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.