Kotlin-Scripting with Gradle dependencies

I learned that I can have a Kotlin-Script script.main.kts that declares dependencies like this:

@file:Repository("https://jcenter.bintray.com")
@file:DependsOn("org.apache.pdfbox:pdfbox:3.0.0-RC1")

import java.io.File
import org.apache.pdfbox.Loader
import org.apache.pdfbox.pdmodel.PDDocument

val pdfFile = File("example_041.pdf")
PDDocument.load(pdfFile)

and run it like this
kotlin script.main.kts

Great.
Now how would the minimal build.gradle.kts look like, that would allow me to manage dependencies using Gradle.

Do I really need five Gradle plugins, a source folder, and a “script base class”, and a “scripting host” class that I need to implement? If so, I’d consider this far beyong the realm of “scripting”.

I guess I would be fine with managing all transitive dependencies using @file:DependsOn instead, but I was under the impression that I could simply use Gradle for this specific aspect.

Regards,
Thomas