Fork me on GitHub
#depstar
<
2021-09-02
>
kirill.salykin14:09:10

Hi Sean, I’ve followed your adviced and implemented the aliases property

clojure '{:mvn/local-repo ".m2"}' -X:uberjar :classpath '"'$(clojure -Sdeps '{:mvn/local-repo ".m2"}' -Spath -A:prod)'"'
but i got these error
WARNING: Implicit use of clojure.main with options is deprecated, use -M
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
{:mvn/local-repo ".m2"} (No such file or directory)
all deps were downloaded (at lease I see ton of
Downloading: org/clojure/core.async/1.3.610/core.async-1.3.610.jar from central
Please advice what i am doing wrong

seancorfield15:09:00

clojure treats the first non-option argument as a script to run. Did you mean -Sdeps in there @kirill.salykin?

kirill.salykin15:09:23

Oh, indeed. Thank you!

seancorfield15:09:20

Why not just

clojure -Sdeps '{:mvn/local-repo ".m2"}' -X:uberjar :aliases '[:prod]'

kirill.salykin15:09:42

As I understand aliases will not save deps into local .m2 folder

kirill.salykin15:09:29

Or use deps from local .m2

seancorfield15:09:44

Why do you want the deps in a different folder? What's the scenario?

kirill.salykin15:09:27

It is gitlab ci, i have a separate step to fetch all deps so other steps shouls jot be concerned about it

kirill.salykin15:09:40

Ans gitlav ci has some issues with not local folders

kirill.salykin15:09:50

(Local to repo)

kirill.salykin15:09:28

I am not recall exactly, but afaik it cant use non local dirsr as artefacta or cache

seancorfield15:09:13

Seems unlikely that it can't cache the standard Maven local repo location -- every single CI I've used can do that.

kirill.salykin16:09:41

maybe something is changed now - but afaik the cached folder should be local to the project dir first found link also uses this approach https://medium.com/devops-with-valentine/caching-maven-dependencies-in-a-gitlab-ci-pipeline-c50017085a2 dunno exact reasons (maybe not the case anymore)

seancorfield16:09:42

OK, so, yeah, in that case you will need:

clojure -Sdeps '{:mvn/local-repo ".m2"}' -X:uberjar :classpath '"'$(clojure -Sdeps '{:mvn/local-repo ".m2"}' -Spath -A:prod)'"'
so that both depstar's deps and your project's deps are downloaded to that local .m2 folder.

kirill.salykin16:09:31

Roger that, thanks a lot for helping!