scala - sbt 多项目构建在项目之间具有测试依赖性?

标签 scala sbt

说我有

lazy val foo = Project(
  id            = "foo",
  base          = file("foo")
)

lazy val bar = Project(
  id            = "bar",
  base          = file("bar")
  dependencies  = Seq(foo)    // only want that for `% "test"`....
)

怎么改bar所以它只取决于测试范围内的 foo ?

最佳答案

你可以这样说:foo % "test->test" .这意味着测试取决于测试。您可以有各种其他选项,例如 foo % "test->test;compile->compile"这意味着它不仅取决于测试,还取决于编译(编译 -> 编译)。你也可以让测试依赖于编译 foo % "test->compile"等等。描述的很好here在文档中。

关于scala - sbt 多项目构建在项目之间具有测试依赖性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21516090/

相关文章:

scala - Spark 连接数组

scala - sbt 中的 Jackson 版本 : 2. 7.1 不兼容?

scala - 使多项目 sbt 项目中的测试仅在依赖项目中的测试通过时才运行

java - Play Framework - 删除对象后无法在 session 中找到用户 ID

java - 如何从外部类以编程方式更新 Scala/Swing?

scala - 如何设置集成测试的 fork JVM 数量?

java - 缺少依赖项 'class javax.annotation.Nullable'

scala - 错误 : `<<=` operator is removed. 使用 `key := { x.value }` 或 `key ~= (old => { newValue })`

scala - 函数式编程: Having a very difficult time understanding how this function lazily evaluates

scala - Scala : Compilation error: Cannot resolve overloaded method