Junit 警告:ID为';spek2和x27;无法使用Gradle v5.2.1发现测试

Junit 警告:ID为';spek2和x27;无法使用Gradle v5.2.1发现测试,junit,gradle-kotlin-dsl,spek,Junit,Gradle Kotlin Dsl,Spek,在Gradle Kotlin DSL中使用Spek 2有点问题。当我右键单击我的测试文件夹并点击运行所有测试时,我得到以下错误:警告:ID为“spek2”的测试引擎无法发现测试。我是否在错误地执行构建脚本?这在子项目中 //子项目build.gradle.kts 插件{ kotlin(“jvm”) JAVA } 依赖关系{ 测试实施(kotlin(“反映”,Vof.kotlin)) 测试实施(kotlin(“测试”,Vof.kotlin)) 测试实施(group=“org.spekframewo

在Gradle Kotlin DSL中使用Spek 2有点问题。当我右键单击我的测试文件夹并点击
运行所有测试
时,我得到以下错误:
警告:ID为“spek2”的测试引擎无法发现测试
。我是否在错误地执行构建脚本?这在子项目中

//子项目build.gradle.kts
插件{
kotlin(“jvm”)
JAVA
}
依赖关系{
测试实施(kotlin(“反映”,Vof.kotlin))
测试实施(kotlin(“测试”,Vof.kotlin))
测试实施(group=“org.spekframework.spek2”,name=“spek dsl jvm”,version=Vof.spek){
排除(group=“org.jetbrains.kotlin”)
}
testRuntimeOnly(group=“org.spekframework.spek2”,name=“spek-runner-junit5”,version=Vof.spek){
排除(group=“org.jetbrains.kotlin”)
排除(group=“org.junit.platform”)
}
testRuntimeOnly(“org.junit.platform:junit平台启动器:${Vof.junitPlatform}”)
测试实施(gradleTestKit())
}
任务{
命名(“测试”){
使用JUnitPlatform{
包括发动机(“spek2”)
}
}
}
我也尝试过使用教程中的格式:

任务{
试验{
使用JUnitPlatform{
包括发动机(“spek2”)
}
}
}
但它也有同样的错误。由于某种原因,Spek无法找到测试。有什么想法吗

编辑:这是完整的堆栈跟踪

Feb 24, 2019 9:41:07 PM org.junit.platform.launcher.core.DefaultLauncher handleThrowable
WARNING: TestEngine with ID 'spek2' failed to discover tests
java.lang.IllegalStateException: clz.java.`package` must not be null
    at org.spekframework.spek2.runtime.scope.PathBuilder$Companion.from(Path.kt:86)
    at org.spekframework.spek2.runtime.SpekRuntime.discover(SpekJvmRuntime.kt:30)
    at org.spekframework.spek2.junit.SpekTestEngine.discover(SpekTestEngine.kt:76)
    at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:177)
    at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:164)
    at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:120)
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:52)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
更新:这被确定为一个bug,并在Spek 2.0.1中修复。