Fork me on GitHub
#leiningen
<
2022-09-14
>
vemv11:09:47

can i create a local .m2 dir after running lein install? Its contents being derived from that command so that I can copy it for Docker purposes

Rupert (All Street)15:09:03

A few options that I have used in the past 1. I used to use a lein plugin for this in the past. https://github.com/djpowell/lein-libdir it generates a directory of all the depenendency jars. 2. Another option that you have is to generate an uberjar (lein uberjar) then you don't have to worry about dependency jars at all. 3. Setup remote maven repo server and push your dependencies there. Do you intend to copy your jars into a docker image?

Rupert (All Street)15:09:30

Seems that m2 location can be overriden with an environment variable

export MAVEN_OPTS="-Dmaven.repo.local=/path/to/repository"
Not tested by me though.

vemv15:09:11

thanks much! I'm having luck with the :local-repo ".m2" option so far

👍 4
mikerod17:09:30

I've used the :local-repo option for things like this

eskos10:09:11

(other libraries based on jib are available as well) https://github.com/GoogleContainerTools/jib does the sensible thing of putting dependencies into its own layer and app to another; read a bit about it, it’s actually really well thought out

thumbnail08:09:51

Plus 1 for jib! We use it in basically all our deployed java / clojure applications. The caching works very good with Github Actions and builds are neat!