Jar task adds source and resources from dependency projects in ear multi project


I try to setup an ear project with mutliple subprojects. To have only compile time dependencies I use

configurations { provided { description = 'Non exported compile-time dependencies' } }
sourceSets {main { compileClasspath += configurations.provided }}
  dependencies {
 provided project(':crm-persistence')
 provided project(':crm-commons')
 provided libraries.jboss

But this adds the souces and resources of crm-persistence, crm-commons to the jar artifact. To define the output.classes of the jar I try something like

task createAdminJar(type: Jar){
 dependsOn classes
 from sourceSets.main.output
 provided createAdminJar

But the source and resources of the dependency projects were still packaged to the jar. Does anybody know, what is wrong with my setup?

Thanks Sascha

I found the solution

 from sourceSets.main.output
 include 'de/greenplanet/admin/**'

Cheers Sascha