将 gradle 升级到 6.x 错误 无法为类型为 org.gradle.api.tasks.testing.Test 的任务':systemtestRun'设置未知属性'testClasse



我正在更新我的应用程序的gradle版本,它是2.3版本,我要到6.7.1

我当然改变了一些东西,但是这个错误我无法解决:

> Could not set unknown property 'testClassesDir' for task ':systemtestRun' of type org.gradle.api.tasks.testing.Test.

build.gradle:

task systemtestRun(type: Test) {
description 'run tests'
testClassesDir = sourceSets.systemtest.output.classesDirs
classpath = sourceSets.systemtest.runtimeClasspath + sourceSets.test.runtimeClasspath }

应该是testClassesDirs而不是testClassesDir:

tasks.register('systemtestRun', Test) {
description = 'Runs system tests.'
group = 'verification'
testClassesDirs = sourceSets.systemtest.output.classesDirs
classpath = sourceSets.systemtest.runtimeClasspath
}