Updating madhead's answer with the new plugin id, this seems to work for me:
Add this to build.gradle:
plugins {
id "com.gradleup.shadow" version "8.3.0"
}
and run ./gradlew shadowJar
According to the docs it looks like the plugin id changed from com.github.johnrengelman.shadow
to com.gradleup.shadow