I have published on github, I hope I am not creating circular posts.
https://github.com/gradle/gradle/issues/30267 (github.com)
I read:
Why tasks.withType(JavaCompile) can’t work? - Help/Discuss - Gradle Forums
But not working for me.
// tasks.withType<JavaCompile> {
tasks.withType<JavaCompile>().configureEach {
// tasks.withType(JavaCompile::class){
options.compilerArgs.add("-parameters")
}