How to build an exploded ear containing exploded wars?

Our ear application is basically configured like this:

dependencies {
    earlib project(path: ":web", configuration:'compile')
    earlib project(path: ":webservices", configuration:'compile')
    deploy project(path: ":web", configuration: "archives")
    deploy project(path: ":webservices", configuration: "archives")

ear {
    archiveName = "app.ear"
    appDirName = "EarContent"
    duplicatesStrategy = EXCLUDE
    excludes = ['lib']
    generateDeploymentDescriptor = false;

My aim is to build an exploded ear using this code:

task explodedEar(type: Sync) {
    group = "build"
    into "${ear.destinationDirectory.get().asFile.absolutePath}/exploded/${ear.archiveFileName.get()}"
    with ear
ear.dependsOn explodedEar

Using this approach the ear is exploded. But the two war files (web, webservices) are simply copied to the exploded directory without being exploded themselves.

How can I achieve that the exploded ear contains the exploded (e.g. unpacked) war files?