Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 2.13.1-错误:错误符号';键入org.scalatest.WordSpec';类路径中缺少_Scala_Playframework_Scalatest - Fatal编程技术网

Scala 2.13.1-错误:错误符号';键入org.scalatest.WordSpec';类路径中缺少

Scala 2.13.1-错误:错误符号';键入org.scalatest.WordSpec';类路径中缺少,scala,playframework,scalatest,Scala,Playframework,Scalatest,我有一个非常简单的sbt项目 [build.sbt] name := "some" version := "0.1" scalaVersion := "2.13.1" libraryDependencies ++= Seq( "org.scalatest" %% "scalatest-mustmatchers" % "3.2.0-M1" % Test, "org.scalatestplus.play" %% "scalatestplus-play" %

我有一个非常简单的sbt项目

[build.sbt]

name := "some"

version := "0.1"

scalaVersion := "2.13.1"

libraryDependencies ++= Seq(
  "org.scalatest"           %% "scalatest-mustmatchers"  % "3.2.0-M1" % Test,
  "org.scalatestplus.play"  %% "scalatestplus-play"    % "5.0.0" % "test",
  "org.scalatestplus"       %% "scalatestplus-mockito" % "1.0.0-M2" % Test
)
sbt.version = 1.3.7
import org.scalatestplus.play.PlaySpec

class PersonSpec extends PlaySpec {
}
[build.properties]

name := "some"

version := "0.1"

scalaVersion := "2.13.1"

libraryDependencies ++= Seq(
  "org.scalatest"           %% "scalatest-mustmatchers"  % "3.2.0-M1" % Test,
  "org.scalatestplus.play"  %% "scalatestplus-play"    % "5.0.0" % "test",
  "org.scalatestplus"       %% "scalatestplus-mockito" % "1.0.0-M2" % Test
)
sbt.version = 1.3.7
import org.scalatestplus.play.PlaySpec

class PersonSpec extends PlaySpec {
}
[src/test/scala/PersonSpec.scala]

name := "some"

version := "0.1"

scalaVersion := "2.13.1"

libraryDependencies ++= Seq(
  "org.scalatest"           %% "scalatest-mustmatchers"  % "3.2.0-M1" % Test,
  "org.scalatestplus.play"  %% "scalatestplus-play"    % "5.0.0" % "test",
  "org.scalatestplus"       %% "scalatestplus-mockito" % "1.0.0-M2" % Test
)
sbt.version = 1.3.7
import org.scalatestplus.play.PlaySpec

class PersonSpec extends PlaySpec {
}
当我在sbt中运行
test
时,我得到了以下错误:

[info] Compiling 1 Scala source to /Users/.../target/scala-2.13/test-classes ...
[error] /Users/.../src/test/scala/PersonSpec.scala:4:26: Symbol 'type org.scalatest.WordSpec' is missing from the classpath.
[error] This symbol is required by 'class org.scalatestplus.play.PlaySpec'.
[error] Make sure that type WordSpec is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
[error] A full rebuild may help if 'PlaySpec.class' was compiled against an incompatible version of org.scalatest.
[error] class PersonSpec extends PlaySpec {
[error]                          ^
[error] one error found
[error] (Test / compileIncremental) Compilation failed
[error] Total time: 5 s, completed Feb 4, 2020 11:50:27 AM

如何修复此错误?

似乎是二进制兼容性问题。我认为
scalatestplus play
是根据以前版本的
scalatestplus mockito
编译的,而这个
1.0.0-M2
版本与那个版本不保持二进制兼容性。谢谢Sarvesh,我要检查一下。