gpt4 book ai didi

clojure - :scope "test" mean in build. 启动依赖是什么?

转载 作者:行者123 更新时间:2023-12-01 13:28:35 26 4
gpt4 key购买 nike

很多例子都有依赖关系写成

[org.clojure/tools.nrepl "0.2.12" :scope "test"]

我认为这意味着不在 prod 构建中包含此依赖项,例如 lein 的开发配置文件,但我找不到任何关于此的文档。还有哪些范围可用?它们在引导中是否具有硬编码的含义,还是用户可以定义的内容?

最佳答案

这直接转换为 Maven scopes .

对于 test :

This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. This scope is not transitive.



在启动时,构建 jar 工件时会排除这些依赖项。此外,当您对项目有依赖时,它们也不算作传递依赖。这也用于在启动项目中指定 Clojure 版本:

Libraries (including Boot tasks) shouldn't depend directly on a Clojure version. Instead, they should use :scope "provided" qualifier with a Clojure dependency. This qualifier makes the dependency non-transitive. Then the dependency works as a documentation about required Clojure version.



Source

关于clojure - :scope "test" mean in build. 启动依赖是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47134947/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com