etorreborre / specs2

Software Specifications for Scala
http://specs2.org
Other
734 stars 215 forks source link

An error while using the "sbt test" command #695

Closed AldusLorde closed 6 years ago

AldusLorde commented 6 years ago

Hello. When i try using the sbt test command, I get an exception related to scalaz.Foldable:

Exception in thread "specs2-3" java.lang.NoClassDefFoundError: scalaz/Foldable Caused by: java.lang.ClassNotFoundException: scalaz.Foldable at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 48 more

If i import scalaz, i get another exception:

Exception in thread "specs2-3" java.lang.NoSuchMethodError: org.specs2.control.origami.Fold.into(Lorg/specs2/control/eff/IntoPoly;)Lorg/specs2/control/origami/Fold; at org.specs2.reporter.JUnitXmlPrinter.sink(JUnitXmlPrinter.scala:28) at org.specs2.reporter.JUnitXmlPrinter.sink$(JUnitXmlPrinter.scala:27) at org.specs2.reporter.JUnitXmlPrinter$.sink(JUnitXmlPrinter.scala:111) at org.specs2.reporter.Reporter.$anonfun$report$2(Reporter.scala:45) at scala.collection.immutable.List.map(List.scala:287) at org.specs2.reporter.Reporter.$anonfun$report$1(Reporter.scala:45) at org.specs2.runner.Runner$.runSpecStructure(Runner.scala:109) at org.specs2.runner.SbtTask.$anonfun$specificationRun$1(SbtRunner.scala:180) at org.specs2.control.eff.Arrs.go$1(Eff.scala:383) at org.specs2.control.eff.Arrs.apply(Eff.scala:399) at org.specs2.control.eff.Interpret.$anonfun$interpretLoop$11(Interpret.scala:198) at org.specs2.control.eff.Arrs.go$1(Eff.scala:383) at org.specs2.control.eff.Arrs.apply(Eff.scala:399) at org.specs2.control.eff.CollectedUnions.$anonfun$othersEff$1(Unions.scala:97) at org.specs2.control.eff.Arrs.go$1(Eff.scala:386) at org.specs2.control.eff.Arrs.apply(Eff.scala:399) at org.specs2.control.eff.Arrs.apply(Eff.scala:348) at org.specs2.control.eff.CollectedUnions.$anonfun$continuation$1(Unions.scala:84) at org.specs2.control.eff.Arrs.go$1(Eff.scala:383) at org.specs2.control.eff.Arrs.apply(Eff.scala:399) at org.specs2.control.eff.Interpret$$anon$1.$anonfun$onEffect$1(Interpret.scala:53) at org.specs2.fp.EitherOps$.bimap$extension(EitherSyntax.scala:82) at org.specs2.control.eff.Interpret$$anon$1.onEffect(Interpret.scala:53) at org.specs2.control.eff.Interpret$$anon$1.onApplicativeEffect(Interpret.scala:61) at org.specs2.control.eff.Interpret$$anon$1.onApplicativeEffect(Interpret.scala:45) at org.specs2.control.eff.Interpret.go$1(Interpret.scala:200) at org.specs2.control.eff.Interpret.interpretLoop(Interpret.scala:207) at org.specs2.control.eff.Interpret.interpretLoop$(Interpret.scala:142) at org.specs2.control.eff.Interpret$.interpretLoop(Interpret.scala:635) at org.specs2.control.eff.Interpret.interpret(Interpret.scala:71) at org.specs2.control.eff.Interpret.interpret$(Interpret.scala:44) at org.specs2.control.eff.Interpret$.interpret(Interpret.scala:635) at org.specs2.control.eff.Interpret.interpret1(Interpret.scala:78) at org.specs2.control.eff.Interpret.interpret1$(Interpret.scala:77) at org.specs2.control.eff.Interpret$.interpret1(Interpret.scala:635) at org.specs2.control.eff.ErrorInterpretation.runError(ErrorEffect.scala:87) at org.specs2.control.eff.ErrorInterpretation.runError$(ErrorEffect.scala:68) at org.specs2.control.eff.ErrorEffect$.runError(ErrorEffect.scala:187) at org.specs2.control.eff.syntax.error$ErrorEffectOps.runError(error.scala:14) at org.specs2.control.ExecuteActions.executeActionFuture(ExecuteActions.scala:36) at org.specs2.control.ExecuteActions.executeActionFuture$(ExecuteActions.scala:31) at org.specs2.control.ExecuteActions$.executeActionFuture(ExecuteActions.scala:90) at org.specs2.runner.SbtTask.$anonfun$executeFuture$3(SbtRunner.scala:147) at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:302) at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

What do i have to do to fix it?

My dependencies: `libraryDependencies += "org.specs2" %% "specs2-core" % "4.2.0" % "test"

scalacOptions in Test ++= Seq("-Yrangepos")

libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.3.0-M24" `

P.s. when i use Intellij Idea to start tests, everything is ok.

AldusLorde commented 6 years ago

Well, i have added this dependency libraryDependencies += "org.specs2" %% "specs2-junit" % "4.3.2" % Test and everything is ok now. I`m sorry for disturbing you.