如果我認為我應該在啟動構建時使用 -Djunit.jupiter.extensions.autodetection.enabled=true,我想在我的專案中默認啟用 junit 擴展自動檢測。
但我想在命令列和我的所有子模塊中默認啟用而無需額外引數。
我這樣的事情應該是好的:
allprojects {
test {
//put an option here
useJUnitPlatform()
}
}
但我不知道在我的 build.gradle 中放入哪個選項。
uj5u.com熱心網友回復:
在 Gradle 中,您可以使用系統屬性擴展:
test {
// ...
systemProperty("junit.jupiter.extensions.autodetection.enabled", true)
}
有關更多詳細資訊,請參閱JUnit 5 用戶指南。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/389645.html
