Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure CLI by

I am attempting to build a Clojure project with numerous dependencies and contain everything into a single folder. The reason for doing this is because I will eventually build this software in an environment where I am not permitted to modify the home folder.

The following command is being used
GITLIBS=/var/build/software/.gitlibs clojure -Srepro -Sdeps '{:mvn/local-repo "/var/build/software/.m2/repository"}' -T:build uber-aot

tools.deps is able to download all dependencies into the specified local repository. Once it's time for tools.build to run, I seem to get an error in the middle of a call to b/create-basis. Here is what the error looks like.

Execution error (FileNotFoundException) at java.io.RandomAccessFile/open0 (RandomAccessFile.java:-2). /home/user/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.pom.part.lock (No such file or directory)

Is there any way to pass in the local Maven repository to tools.build? Preferably in the command line.

1 Answer

0 votes
by
selected by
 
Best answer

When you call create-basis you can pass the equvialent of -Sdeps with the :extra key:

(create-basis  {:extra {:mvn/local-repo "your/path"}})

Docs:
https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-create-basis

...