Configure plugin repos from init script for settings plugins

I have written a settings plugin that I am publishing to a private Artifactory repo. I would like to use a custom Gradle distribution centralize the configuration of our repos. So I have tried to use this init script (in the Kotlin DSL) to achieve that:

settingsEvaluated {
    pluginManagement {
        repositories {
            maven {
                url = uri("MY_ARTIFACTORY_REPO")
            }
            gradlePluginPortal()
        }
    }
}

The problem is that since settingsEvaluated runs after the project’s settings.gradle.kts script is evaluated, I cannot apply settings plugins from my repo. Is there any earlier way to configure the pluginManagement block such that the settings.gradle.kts file can use those repos?

beforeSettings { ... }

Thanks!

Looks like I was looking at the Gradle DSL docs which doesn’t list that method. I see it now in the javadocs.
Working great!

Maybe you should create an issue about that then :slight_smile: