Support for taking relocations directly from shadowJar into the dependency files generated by the Gradle plugin (via the includeShadowJarRelocations option) might be removed in the future.
Doing it requires doing reflection to access the relocations, is unreliable and only seems to be becoming more unreliable in the most recent Gradle versions.
The recommended replacement is doing something like this:
[
'org.apache.commons',
'com.google.gson'
].each {
var relocated = 'com.example.myapp.dependencies.' + it
tasks.shadowJar.relocate it, relocated
tasks.generateRuntimeDownloadResourceForRuntimeDownloadOnly.relocate it, relocated
}