How to accept Gradle ToS for `build --scan` automatically and still manage to run build without a scan?

后端 未结 2 1121
小鲜肉
小鲜肉 2021-01-18 04:25

I am using Gradle 4.6 which allows me to run build scans using the --scan option without having to explicitly apply or download extra plugins

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-18 05:00

    This might not be a good or proper solution, but here's one workaround: use a try/catch to swallow the error, something like:

    try {
        buildScan {
            termsOfServiceUrl = 'https://gradle.com/terms-of-service'
            termsOfServiceAgree = 'yes'
        }
    } catch (MissingMethodException e){
       // This isn't the exception you're looking for
    }
    

提交回复
热议问题