I know I can add --no-scan
on an individual command line (see https://docs.gradle.com/build-scan-plugin/), but I'm looking for a way to disable this in build.gradle
, gradle.properties
or settings.gradle
so i dont have to always type it or set an alias.
Any Ideas on how that can be done?
You can edit your hosts
file on your computer and place the entry where it is sending the reports to 127.0.0.1
. It will print some errors after every build, but that is all.
Another possibility is to add --no-scan
to gradle
command or wrapper script.
You can query gradle parameters (tasks, flags...etc.) through StartParameter and fail a build early if it runs with --scan
flag as reported by StartParameter.isBuildScan().
The release of Gradle is not specified in the question and that API is available since Gradle 3.1. I believe it was incubating until Gradle 5.X.
if (gradle.startParameter.isBuildScan()) {
throw new GradleException("you shall not scan")
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With