How do I use the Gradle Shadow Plugin to merge spring.handlers and spring.schemas files of multiple Spring jar dependencies?

Thank you for the reply.

I first tried adding that snippet of code to the build file as shown below and ran the shadowJar task but I got the following error:

Could not find method mergeServiceFiles() for arguments [META-INF, build_uikua424h66rqmcd6pekgkm62$_run_closure1_closure3@28341220] on project ':EmailConsumer'

I then tried variations of the syntax. The first was:

shadowJar {
    mergeServiceFiles('META-INF')
    include 'spring.*'
}

after which I ran shadowJar followed by runShadow:

Error: Could not find or load main class com.se.email.submexch.consum.PollingConsumer

which is rather odd. Perhaps the Manifest file got merged as well?

I also tried

shadowJar{
      mergeServiceFiles('META-INF/spring.*')
}

and ran shadowJar followed by runShadow, but that just gives me the same ‘could not find namespace handler’ that I mentioned in my original post. Any ideas?