【发布时间】:2019-05-28 21:40:56
【问题描述】:
运行时
sbt 编译
在项目根目录中出现错误:
object junit is not a member of package org
[error] import org.junit.Test
我已经完全定义了 build.sbt:
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v")
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.0" % "test
libraryDependencies += "junit" % "junit" % "4.12" % "test"
文件 TestSingleLinkedList.scala 也在项目根目录中,并且具有:
import org.junit.Test
【问题讨论】:
-
你在 src/test 中使用 junit 吗?
-
@galando - 这个错误有很多 stackoverlow 答案 - 我确实检查了每一个并且目前 - 它们不适用。您提供的是关于将 build.sbt 放在根目录中的内容 - 我已经有了。
-
@DraifKroneg - 好的,只是想确认一下 :)