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

**URL:** <https://discuss.gradle.org/t/how-do-i-use-the-gradle-shadow-plugin-to-merge-spring-handlers-and-spring-schemas-files-of-multiple-spring-jar-dependencies/6713>\
**Category:** Old Forum Archive\
**Created:** [January 19, 2015, 12:15am UTC](https://discuss.gradle.org/t/how-do-i-use-the-gradle-shadow-plugin-to-merge-spring-handlers-and-spring-schemas-files-of-multiple-spring-jar-dependencies/6713 "2015-01-19T00:15:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Tam\_Le](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@Tam\_Le](https://discuss.gradle.org/u/Tam_Le)\
**Post date:** [January 19, 2015, 4:22am UTC](https://discuss.gradle.org/t/how-do-i-use-the-gradle-shadow-plugin-to-merge-spring-handlers-and-spring-schemas-files-of-multiple-spring-jar-dependencies/6713/3 "2015-01-19T04:22:00Z")

</div>

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:

```gradle
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:

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

```

after which I ran shadowJar followed by runShadow:

```gradle
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

```gradle
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?

---

_[View the full topic](https://discuss.gradle.org/t/how-do-i-use-the-gradle-shadow-plugin-to-merge-spring-handlers-and-spring-schemas-files-of-multiple-spring-jar-dependencies/6713)._
