Building JEE Application Under Eclipse

I’m trying to build my JEE project within eclipse using Gradle. So far without any success.
My eclipse workspace structure is as follows:
ExampleEar - An EAR project
ExampleEJB - An EJB project
ExampleREST - A Rest project

My problem is to build correctly the EAR project. The issue starts when I try to deploy the EJB under the Ear root directory. To do so, I must configure EJB facet for the EJB project.
In order to enable facet support, I must apply the ‘war’ plugin for the EJB project. From this point, the EJB JAR file is placed correctly within the Ear file. However, the content of the EJB JAR is incorrect. The JAR is built as an WAR file with the following structure:

Now, my question is:
How can I manage my eclipse workspace such that the Ear file will be created correctly?