Gradle Junit 5 ParameterizedTest注释在Gralde中引发意外的令牌错误

Gradle Junit 5 ParameterizedTest注释在Gralde中引发意外的令牌错误,gradle,junit5,Gradle,Junit5,最近尝试将我的测试用例更新为JUnit5。但无法获得参数化的注释工作 startup failed: MyGroovyTests.groovy: 181: unexpected token: @ @ line 181, column 5. @ParameterizedTest(name = "test") ^ 1 error build.gradle具有以下功能 dependencies { implementation 'org.co

最近尝试将我的测试用例更新为JUnit5。但无法获得参数化的注释工作

startup failed:
MyGroovyTests.groovy: 181: unexpected token: @ @ line 181, column 5.
       @ParameterizedTest(name = "test")
       ^
1 error
build.gradle具有以下功能


dependencies {
    implementation 'org.codehaus.groovy:groovy-all:2.5.14'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
    testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
    testImplementation 'org.junit.jupiter:junit-jupiter-params:5.4.2'
}

test {
    useJUnitPlatform()
}
groovy版本:2.5.14 渐变版本:6.8.1
junit版本:5.4.2

错误消息是什么?