【发布时间】:2013-09-20 08:34:28
【问题描述】:
task scalaTest(dependsOn: testClasses) << {
description = 'Runs Scalatest suite'
ant.taskdef(name: 'scalatest',
classname: 'org.scalatest.tools.ScalaTestAntTask',
classpath: sourceSets.test.runtimeClasspath.asPath
)
ant.scalatest(runpath: sourceSets.test.output.classesDir,
haltonfailure: 'true', fork: 'false') {
reporter(type: 'stdout')
}
}
我运行 gradle scalaTest 并得到:
* What went wrong:
Execution failed for task ':scalaTest'.
> java.lang.NoClassDefFoundError: scala/reflect/ClassManifest$
我正在使用 Scala 2.10.2 和 Gradle 1.7
dependencies {
compile 'org.scala-lang:scala-library:2.10.2'
testCompile 'org.scalatest:scalatest:1.3'
testCompile 'org.scalamock:scalamock_2.10:3.0.1'
}
怎么了??
【问题讨论】:
-
您好像缺少
scala-reflect。无论如何,最好通过 Gradle 的 JUnit 支持运行测试。