java.lang.NoClassDefFoundError: scala / Product $ class
Soy nuevo en scala y estoy probando algunos códigos de muestra para probar. Sin embargo, estoy enfrentando algunos problemas cuando ejecuto el código de prueba. Cuando ejecuto la prueba, recibo un error
[trace] Stack trace suppressed: run last test:executeTests for the full output.
[error] (test:executeTests) java.lang.NoClassDefFoundError: scala/Product$class
[error] Total time: 3 s, completed Feb 27, 2017 6:57:15 PM
Mi código es el siguiente
FilterChecks.scala
class filterChecks extends FlatSpec {
"Filter checker passed a filename which is present in directory" should "return file name" in {
val matchingFileName = new FileObject("match")
val listOfFiles = List(new FileObject("random"), matchingFileName)
val matchedFiles = new FilterChecker("match").findMatchedFiles(listOfFiles)
assert(matchedFiles == List(matchingFileName))
}
}
Clase FilterChecker
class FilterChecker(filter : String) {
def matches(content : String) = content.contains(filter);
def findMatchedFiles(fileObjects : List[FileObject]) = {
for(fileObject <- fileObjects if(matches(fileObject.name)))
yield fileObject
}
}
FileObject
class FileObject(val name: String) {
}
El archivo de compilación es el siguiente:
name := "testScalaProject"
version := "1.0"
scalaVersion := "2.12.1"
// https://mvnrepository.com/artifact/org.scala-js/scalajs-test-interface_2.12
libraryDependencies ++= Seq("org.scala-js" % "scalajs-test-interface_2.12" % "0.6.14",
"org.scalatest" % "scalatest_2.11" % "2.2.5",
"com.novocode" % "junit-interface" % "0.11",
"org.scala-lang" % "scala-library" % "2.12.1")
¿Podría alguien ayudarme a encontrar el problema? Gracias por adelantado