Always applying the Gradle Enterprise plugin

What is this?
Learn how to configure the Gradle Enterprise plugin in an init script to avoid committing agreement to the terms of service into published projects.?

I want to run the Gradle Enterprise plugin for every build, but Gradle say:

Be careful not to commit agreement to the terms of service into a project that may be built by others.

So I don't want to add the plugin to the settings of any projects I publish.

The good news is that Gradle has a mechanism to set up "init" scripts, defined in user scope. The bad news is that I couldn't find any documentation on how to set up the Gradle Enterprise plugin in an init script.

So: put this content in a file located in your init scripts directors, say ~/.gradle/init.d/scans.gradle:

initscript {
    repositories {
    dependencies {

getGradle().settingsEvaluated { settings ->

    settings.gradleEnterprise {
        buildScan {
            termsOfServiceUrl = ""
            termsOfServiceAgree = "yes"

Then make sure you remember to bump the version regularly as I'm not aware of any tooling to help do that.