Fork me on GitHub
#tools-build
<
2023-05-08
>
Casey18:05:48

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)18:05:55

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

Alex Miller (Clojure team)18:05:41

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

Casey18:05:46

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

Alex Miller (Clojure team)18:05:10

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

Casey18:05:11

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

Casey18:05:44

Ah I might be using tools.build incorrectly

Casey18:05:40

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

Casey18:05:51

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)18:05:09

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)18:05:56

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

Casey19:05:18

many thanks