tools-build 2023-05-08

How can I teach tools.build to look for local jars in a dir other than ~/.m2/repository ? I have the top level key :mvn/local-repo in my deps.edn which works for running code/repl, but not when I'm trying to build an uber jar with tools.build

Alex Miller (Clojure team) 2023-05-08T18:11:55.896439Z

can you be more specific about which tools.build task doesn't work?

Alex Miller (Clojure team) 2023-05-08T18:12:41.547879Z

in general, tools.build tasks are driven by the basis you are using (created via create-basis in your build script), and that will (by default) use your project deps.edn, including it's :mvn/local-repo setting

clojure.tools.build.api/uber is the function i'm calling

Alex Miller (Clojure team) 2023-05-08T18:14:10.042339Z

what you are describing should work. why do think the :mvn/local-repo is not being used

here is the error report. To simulate the ci environment this should run in locally i have symlinked ~/.m2 -> dev/null

Ah I might be using tools.build incorrectly

aha, so I misspoke. :mvn/local-repo is not defined in my project's deps.edn but in my ~/.config/clojure/deps.edn . If I copy it to my project deps, then the uberjar builds

I would prefer not to define it in the project.deps since that would affect all developers building the project. Shouldn't :mvn/local-repo work if defined in the global deps.edn?

Alex Miller (Clojure team) 2023-05-08T18:30:09.686839Z

Yeah, the basis used in tools.build does not include that deps.edn source by default for reproducibility reasons, but you can do so if you like

Alex Miller (Clojure team) 2023-05-08T18:30:56.485139Z

In the call to create-basis, pass :user :standard