I was able to get this working with a fat JAR. It was a bit of a pain to set up, although I thought I’d share the solution in case it helps others.
I created a new gradle module to pull in my dependencies and relies on the Shadow plugin to merge everything together. The trick was excluding transitive dependencies, so they don’t get included in the JAR. The build.gradle.kts looks something like this:
// exclude things available within the Kotlin notebook environment