# Create jar with multiple source folders and different includes

**URL:** <https://discuss.gradle.org/t/create-jar-with-multiple-source-folders-and-different-includes/21597>\
**Category:** Help/Discuss\
**Created:** [February 15, 2017, 9:04am UTC](https://discuss.gradle.org/t/create-jar-with-multiple-source-folders-and-different-includes/21597 "2017-02-15T09:04:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JanWe](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/janwe/32/6027_2.png) [@JanWe](https://discuss.gradle.org/u/JanWe)\
**Post date:** [February 15, 2017, 9:04am UTC](https://discuss.gradle.org/t/create-jar-with-multiple-source-folders-and-different-includes/21597/1 "2017-02-15T09:04:59Z")

</div>

Hello,

converting our build from ant to gradle, I currently fail in creating a jar.  
Say, we have folders source1 and source2, both contain xml, xsd and class files.  
In the resulting jar the following files should be contained:

```
source1/**/*.xml
source1/**/*.xsd
source2/**/*.class

```

I tried the following:

```gradle
    task createJar(type: Jar){
        from {
            files("source1")
            include " **/*.xml", "** /*xsd"
        }
        from {
            files("source2")
            include "**/*.class"
        }
        archiveName = "myJar.jar"
    }
```

and fail:  
Circular dependency between the following tasks:  
:createJar  
— :createJar (\*)

Can someone help me?

Thanks  
Jan
