Removing WAR from published artifacts in multi-project EAR build

I have a normal EAR build using the EAR plugin in Gradle 1.6.

build.gradle
->ear
--->build.gradle
->war
--->build.gradle

The ear build.gradle contains this:

dependencies {
    deploy project(path: ':war',configuration:'archives')
    compile project(path: ':war', configuration:'providedCompile')
}

Because the EAR contains the WAR (these two always have the same lifecycle in this project), I don’t want to publish the WAR as part of the build, but the WAR plugin seems to add the war to “artifacts”.

Is there any way to prevent this from happening?

The simplest solution would be to disable the uploadArchives task of the war project…

war/build.gradle:

uploadArchives.enabled = false

Perfect! I’ve hunted high and low for this. Thank so much.

You’re most welcome.