似乎是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.
有解决办法吗?
最佳答案
TLDR;找不到解决方法,所以我将其降级
问题不在于 Play,而在于 specs2。我的 specs2 版本使用:scalaz-core
版本 7.1.1
。您可以使用 sbt dependency graph plugin 找到您自己的(该插件似乎隐藏了测试范围的依赖项:从 specs2 依赖项中删除 test
范围)
我不得不将 scalaz-core 版本降级到 7.1.1
"org.scalaz" %% "scalaz-core" % "7.1.1"
干杯
关于playframework - 如何将 Play 2.4.x 与 scalaz 7.2.0 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34679076/