Hi,
I have two gradle projects
ProjectA
— The gradle build script in ProjectA creates war and ear file, say ProjA.ear and ProjA.war respectively. the ear file just contains the war.
snippet of build.gradle
apply plugin: ‘war’
- dependencies {*
-
compile project(':AnotheProject')*
-
}*
-
- war {*
-
archiveName = 'ProjA.war'*
-
}*
}
apply plugin: ‘ear’
-
dependencies {*
-
earlib project (’:AnotheProj’)*
-
}*
-
ear {*
-
includeEmptyDirs = false*
-
from war.archivePath*
-
archiveName = ‘ProjA.ear’*
-
deploymentDescriptor {*
-
applicationName = ‘ProjA’*
-
initializeInOrder = true*
-
displayName = ‘ProjA’*
-
webModule(‘ProjA.war’,‘ProjAWeb’) *
-
}*
-
} *
ear.dependsOn war
============================
ProjectB
— The gradle script should create a ear, say* ProjB.ear* which should contain the war file from ProjectA, ProjA.war
I am using ear plugin in Project B, in dependencies I add the below line
- deploy project(path:’:ProjectA’, configuration:‘archives’)*
When I run gradle on project B the * ProjB.ear* created with * ProjA.ear*, but I want ProjA.war to be included in ProjB.ear.
Could anyone has any idea on this??
I am new to gradle and will appreciate your help…