把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類此處:
```java
@Override
public Test systemProperty(String name, Object value) {
forkOptions.systemProperty(name, value);
return this;
}
```