为什么设置(在汇编中测试)会给出类型错误?

时间:2015-07-20 23:18:49

标签: sbt sbt-assembly

我在多模块项目中使用sbt 0.13.8和sbt-assembly 0.13.0。一切都很好,直到我试图在组装过程中关闭测试。

按照文档中的说明,我添加了一行

test in assembly := {}

在我的某个模块的设置中并收到以下错误

/Users/lanny/work/IdeaProjects/Search/build.sbt:61: error: type mismatch;
 found   : sbt.TaskKey[sbt.File]
 required: java.io.File
      test in assembly := {},
          ^
sbt.compiler.EvalException: Type error in expression

我很乐意展示'检查测试'的结果但是,我不能在没有删除导致错误的行的情况下运行sbt。这是我删除的行所看到的内容。

[info] Set current project to search-hadoop (in build file:/Users/lanny/work/IdeaProjects/Search/)
> inspect assembly::test
[info] Task: Unit
[info] Description:
[info]  Executes all tests.
[info] Provided by:
[info]  {file:/Users/lanny/work/IdeaProjects/Search/}hadoop/*:assembly::test
[info] Defined at:
[info]  (sbtassembly.AssemblyPlugin) AssemblyPlugin.scala:32
[info] Dependencies:
[info]  hadoop/test:test
[info] Reverse dependencies:
[info]  hadoop/*:assemblyPackageScala::test
[info]  hadoop/*:assemblyPackageDependency::test
[info]  hadoop/*:assembly
[info] Delegates:
[info]  hadoop/*:assembly::test
[info]  hadoop/*:test
[info]  {.}/*:assembly::test
[info]  {.}/*:test
[info]  */*:assembly::test
[info]  */*:test
[info] Related:
[info]  test/*:assemblyPackageDependency::test
[info]  third_party/test:test
[info]  third_party/*:assemblyPackageDependency::test
[info]  search/*:assembly::test
[info]  search/*:assemblyPackageScala::test
[info]  server/*:assemblyPackageDependency::test
[info]  search/*:assemblyPackageDependency::test
[info]  server/test:test
[info]  hadoop/test:test
[info]  hadoop/*:assemblyPackageScala::test
[info] ...

2 个答案:

答案 0 :(得分:0)

sbt.Keys.test in assembly := {}

诀窍。

答案 1 :(得分:0)

正如documentation中所述,对于sbt 0.13.6+,将此行添加到项目/ assembly.sbt

scrollTop: $(this).offset().top - 260