把build.gradle里的test标签的属性systemProperties末尾加个2:
build报错:
What went wrong: A problem occurred evaluating root project ‘quickstart’. Could not find method systemProperties2() for arguments [{property=value}] on task ‘:test’ of type org.gradle.api.tasks.testing.Test.
这个Test类的地址: gradle-6.0\src\testing-jvm\org\gradle\api\tasks\testing
在这个类的注释里就能看到给测试jvm设置system property的语法:
读取build.properties里定义的property值并进行JVM设置的实现代码位于Test类此处:
@Override
public Test systemProperty(String name, Object value) {
forkOptions.systemProperty(name, value);
return this;
}