Should be able to do something like this.
shadowJar {
mergeServiceFiles(‘META-INF’) {
include ‘spring.*’
}