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 file, which is never checked in to preserve security.

How do I convert this to Kotlin?

build.gradle (pre-kotlin)

buildscript {
    repositories {
        maven {
            url "${artifactory_url}/plugins-release"
            credentials {
                username = "${artifactory_user}"
                password = "${artifactory_password}"
    dependencies {