使用 Scoverage 的问题:Scala Sbt

Issues with using Scoverage: Scala Sbt

我将 scoverage 插件添加到 projects/plugins.sbt

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")

我能够使用

生成测试覆盖率
sbt clean coverage test
sbt coveragereport

然而,当我尝试将 socverage 配置添加到我的 build.sbt 时。我看到构建错误

error: value ScoverageKeys is not a member of object scoverage.ScoverageSbtPlugin
ScoverageSbtPlugin.ScoverageKeys.coverageMinimum := 70

看起来 build.sbt 没有找到 Scoverage 类。这是怎么回事?

检查 that。看来你需要的是:

scoverage.ScoverageKeys.coverageMinimum := 70