dependsOnChildren()

allprojects {
    usePlugin('java')
    group = 'org.gradle.sample'
    version = '1.0'
}

subprojects {
    usePlugin('war')
    repositories {
        mavenCentral()
    }
    dependencies {
        compile "javax.servlet:servlet-api:2.5"
    }
}

task explodedDist(dependsOn: libs) << {
    File explodedDist = mkdir(buildDir, 'explodedDist')
    subprojects.each {project ->
        project.tasks.withType(Jar).each {archiveTask ->
            ant.copy(file: archiveTask.archivePath, todir: explodedDist)
        }
    }
}
