Custom maven plugin repository, with authentication, in Kotlin

I am at the beginning of converting our gradle builds to version 5 with Kotlin, and I got stuck right up front.

We use Artifactory for our artifact storage, and that includes gradle plugins which we developed in house. Every one of our build files starts with the buildscript section (below) where we define our Artifactory plugins endpoint so we can use our company plugins. Near as I can tell, you can’t use the buildscript block in Kotlin.

I found documentation where it says you can use a “trick”, and use the pluginmanagement block in your settings.gradle.kts, but that means we cannot use the placeholders for the user/pass, which we normally get from the gradle.properties file, which is never checked in to preserve security.

How do I convert this to Kotlin?

build.gradle (pre-kotlin)

buildscript {
    repositories {
        mavenLocal()
        maven {
            url "${artifactory_url}/plugins-release"
            credentials {
                username = "${artifactory_user}"
                password = "${artifactory_password}"
            }
        }
    }
    dependencies {
        classpath("org.jfrog.buildinfo:build-info-extractor-gradle:4.9.0")
        classpath("com.comcast.esp.gradle:esp-test-task:[1.3.0,1.4.0)")
        classpath("com.comcast.esp.gradle:esp-sonar-task:[0.2.0,0.3.0)")
    }
}

gradle.properties

artifactory_user=[username]
artifactory_password=[encrypted_password]
artifactory_url=[artifactory_url]