testing - 如何在 Leiningen 中声明测试范围依赖项?

标签 testing dependencies leiningen

如何声明仅在测试中使用的依赖项,即部署的工件不需要它们?

相当于maven<scope>test</scope> :

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>

相当于sbt% "test" :

libraryDependencies += "org.apache.derby" % "derby" % "10.4.1.3" % "test"

最佳答案

将其添加到 :dev 配置文件中:

(defproject your-project "1.0.0"
  :dependencies [[some-normal-library "1.0.0"]]
  :profiles {:dev {:dependencies [[some-test-library "1.0.0"]]})

莱宁根文档 profiles说:

The :dev profile is used to specify project specific development tooling. Put things here if they are required for builds or tests, rather than just convenience tooling.

关于testing - 如何在 Leiningen 中声明测试范围依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58679933/

相关文章:

java - 有一个用于用户注册的 junit 测试用例有意义吗?

java - Swagger api 客户端方法返回 void

c++ - 我的文件依赖性有什么问题?

dependencies - Dartlang 中的依赖问题

java - 无法在 Windows Clojure 项目上使用 clj-http

ruby 类型错误 : no implicit conversion of String into Array

javascript - 如何在 Protractor 中识别这个元素?

javascript - 在 JavaScript 最佳实践中组织库依赖项

clojure - 在 Leiningen 中使用 redis-clojure 时出现问题

clojure - 如何将 lamina/aleph 安装到 Clojure?