I found that the ear plugin overrides the war plugin and prevents the war task being called. I got around it by calling it directly.
Is this remotely sensible or should I give up and move to a multi-project setup in eclipse and gradle?
ear {
doFirst {
println " - force build war..."
tasks.war.execute()
}
from("$destinationDir") {
exclude('nz')
rename ('TrialApp(.*)(.war)', 'TrialApp.war')
include 'TrialApp*.war'
into('')
}
deploymentDescriptor {
applicationName = "trialapp"
initializeInOrder = true
displayName = "Trial App"
description = "Trial App EAR for Gradle documentation"
libraryDirectory = "WEB-INF/lib"
webModule("TrialApp.war", "TrialApp")
}
}