我需要能够配置gradle以使其始终使用根目录中的“ gradle.properties”或“ init.gradle”设置“ --continue”标志。甚至可能吗?如果可以,怎么办?
答案 0 :(得分:1)
只需创建文件settings.gradle
并添加
startParameter.continueOnFailure = true
演示build.gradle
task t1 {
doLast {
throw new RuntimeException("fail")
}
}
task t2 {
doLast {
println "ok"
}
}
没有以上settings.gradle
:
$ gradle t1 t2
> Task :t1 FAILED
具有以上settings.gradle
:
$ gradle t1 t2
> Task :t1 FAILED
> Task :t2
ok
更多信息:
https://docs.gradle.org/current/dsl/org.gradle.api.initialization.Settings.html https://docs.gradle.org/current/javadoc/org/gradle/StartParameter.html