Gradle duplicate the war file with different name and context

Hi,

I have a specific requirement, I would like to duplicate the war file with different name in ear file.

e.g My Ear Name: A.ear will contain B.war and C.war , And B and C are exact replica of source code.
I have applied ear plugin and war plugin in all my sub projects.

Part of ear gradle file looks like this.
dependencies {
deploy project(path: ‘:api:B’, configuration: ‘warFile’)
//How can I apply C here??
}

How I can deploy C as well which is replica of B.

My application.xml will be like this after (sorry I dont know how xml tags will work)

<module>
<web>
<web-uri>B.war <web-url>
<context-root> api </context-root>
</web>
</module>

<module>
<web>
<web-uri> C.war </web-url>
<context-root> newcontext </context-root>
</web>
</module>

Could you please help?