Playframework 如何在scalaz 7.2.0中使用Play 2.4.x

Playframework 如何在scalaz 7.2.0中使用Play 2.4.x,playframework,scalaz,specs2,Playframework,Scalaz,Specs2,由于specs2的版本,似乎存在一些问题 以下是编译测试时出现的错误: [error] Uncaught exception when running ServiceSpec: java.lang.IncompatibleClassChangeError: Found class scalaz.Memo, but interface was expected [trace] Stack trace suppressed: run last test:test for the full outpu

由于specs2的版本,似乎存在一些问题

以下是编译测试时出现的错误:

[error] Uncaught exception when running ServiceSpec: java.lang.IncompatibleClassChangeError: Found class scalaz.Memo, but interface was expected
[trace] Stack trace suppressed: run last test:test for the full output.
[error] Uncaught exception when running ApplicationSpec: java.lang.NoClassDefFoundError: Could not initialize class org.specs2.main.Arguments$
[trace] Stack trace suppressed: run last test:test for the full output.
[error] Uncaught exception when running IntegrationSpec: java.lang.NoClassDefFoundError: Could not initialize class org.specs2.main.Arguments$
[trace] Stack trace suppressed: run last test:test for the full output.
[error] Uncaught exception when running FileImportSpec: java.lang.NoClassDefFoundError: Could not initialize class org.specs2.main.Arguments$
[trace] Stack trace suppressed: run last test:test for the full output.
有解决办法吗?

Yann,看看如何尝试强制使用scalaz版本

我相信在build.sbt(未测试)中您需要类似的东西


TLDR;找不到解决方法,所以我将其降级

问题不在于游戏,而在于规格2。我的specs2版本使用:
scalaz core
version
7.1.1
。您可以使用找到自己的(插件似乎隐藏了测试范围的依赖项:从specs2依赖项中删除
test
范围)

我不得不将scalaz核心版本降级到7.1.1

  "org.scalaz" %% "scalaz-core" % "7.1.1"

干杯

我刚才也遇到了同样的问题,只是为了玩2.5.x。scalaz和specs2的升级版本为我解决了这个问题:

libraryDependencies ++= Seq(
  "org.scalaz" %% "scalaz-core" % "7.2.7",
  "org.specs2" %% "specs2-core" % "3.8.6" % "test"
)

也许人们会发现这很有帮助;)

您是否检查了scalaz版本并确保它是7.2.0?。你可能有另一个版本。将目标/分辨率缓存/reports/_2.11-test.xml加载到浏览器中。您可能会发现,由于冲突,您没有安装7.2.0。我过去也遇到过类似的问题,虽然解决起来并不总是那么容易,但它至少能识别出你的问题。你是对的。7.1在试验中。有什么好办法吗?不幸的是,没办法!以test==>test:dependcyGraph作为前缀。因此,它将显示测试范围
libraryDependencies ++= Seq(
  "org.scalaz" %% "scalaz-core" % "7.2.7",
  "org.specs2" %% "specs2-core" % "3.8.6" % "test"
)