How to imitate setting a property in the file via custom plugin

I am writing a custom Gradle plugin in Java. Internally it applies the kotlin-gradle-plugin to the consuming project.

plugins {
    id 'java-gradle-plugin'

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"
public class CustomPlugin implements Plugin<Project> {

    public void apply(@NotNull Project project) {

Kotlin plugin, by default, adds a dependency on Kotlin’s standard library, and to disable that behavior, one needs to add the following to the file:


Is there a way to simulate the presence of such property in the custom plugin itself, to save the end user the trouble of adding the above mentioned line into the file?