How does "lein deps" work?

Can someone tell me how the lane works? If lein finds the dependency, which is the necessary version for the project, in ~ / .m2, will the lane still download the same package again?

+5
source share
1 answer

Lets break this down into several questions, and I will try to give a brief idea of โ€‹โ€‹each:

  • Any people tell me how the lane works?
    The goal of the deps goal is to ensure that every dependency needed to run this project is available in your local maven repository. In short, it fills ~ / .m2 / ... with jars , which must be on the class path to start the project

  • If lein finds the dependency, which is the necessary version of the project, in ~ / .m2, will the lane still load the same package again?
    No, it only uploads files as needed, not to a local repo. By default, although lein only checks for new versions of snapshots once every 24 hours , you can do this more often by running "lein -U deps"

After the lane disintegration is completed and the packages are available, then the lane can start jvm, passing the places of each of the necessary jars as parameters of the path class as follows:

java -classpath /project/path/test:/project/path/src: /project/path/dev-resources:/project/path/resources: /project/path/target/classes: /home/ubuntu/.m2/repository/org/apache/maven/maven-model-builder/3.0.4/maven-model-builder-3.0.4.jar: /home/ubuntu/.m2/repository/org/apache/maven/maven-repository-metadata/3.0.4/maven-repository-metadata-3.0.4.jar: /home/ubuntu/.m2/repository/org/apache/maven/wagon :/home/ubuntu/.m2/repository/org/clojure/tools.analyzer/0.1.0-beta12/tools.analyzer-0.1.0-beta12.jar: /home/ubuntu/.m2/repository/org/tcrawley/dynapath/0.2.3 ... lots more paths here ... 

Once upon a time, lein used to copy them to a local folder in a project, it doesnโ€™t do this anymore, and you can ignore any documentation that says that you run โ€œlein cleanโ€ (although it will not hurt to run it if you trying to clear strange crashes after compiling AOT)

+10
source

Source: https://habr.com/ru/post/1212231/


All Articles