# Problem building an ear that includes war and some JARs from other subprojects

**URL:** <https://discuss.gradle.org/t/problem-building-an-ear-that-includes-war-and-some-jars-from-other-subprojects/30173>\
**Category:** Help/Discuss\
**Created:** [January 14, 2019, 1:44pm UTC](https://discuss.gradle.org/t/problem-building-an-ear-that-includes-war-and-some-jars-from-other-subprojects/30173 "2019-01-14T13:44:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DonKanaille](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@DonKanaille](https://discuss.gradle.org/u/DonKanaille)\
**Post date:** [January 14, 2019, 1:44pm UTC](https://discuss.gradle.org/t/problem-building-an-ear-that-includes-war-and-some-jars-from-other-subprojects/30173/1 "2019-01-14T13:44:33Z")

</div>

Hello everyone,

i got some understanding problems how to build a war / ear from a multi project. Actual i trie to migrate a project from maven to gradle.

Project Structure…

Project

/— Web  
\_\_\_\_/—build  
\_\_\_\_\_\_\_\_/— classes  
\_\_\_\_\_\_\_\_/— libs  
\_\_\_\_\_\_\_\_\_\_\_\_/—EJB.jar  
\_\_\_\_\_\_\_\_/— tmp  
\_\_\_\_/— libs  
\_\_\_\_\_\_\_\_/— Web.war // atucal war, what i need is a ear that include the war and all the needed jars from the other Subprojects  
\_\_\_\_/— src  
\_\_\_\_\_\_\_\_/— main  
\_\_\_\_\_\_\_\_\_\_\_\_/— java  
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_/— …

/— EJB  
\_\_\_\_/—build  
\_\_\_\_\_\_\_\_/— classes  
\_\_\_\_\_\_\_\_/— libs  
\_\_\_\_\_\_\_\_\_\_\_\_/—EJB.jar  
\_\_\_\_\_\_\_\_/— tmp  
\_\_\_\_/— libs  
\_\_\_\_\_\_\_\_/— A.jar  
\_\_\_\_\_\_\_\_/-- B.jar  
\_\_\_\_\_\_\_\_\_\_\_\_/— C.jar  
\_\_\_\_/— src  
\_\_\_\_\_\_\_\_/— main  
\_\_\_\_\_\_\_\_\_\_\_\_/— java  
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_/— …

/— Shared  
\_\_\_\_/— (…)  
\_\_\_\_\_\_\_\_/— (…)

/— ServerClientModule  
\_\_\_\_/— (…)  
\_\_\_\_\_\_\_\_/— (…)

/— SwingClientModule  
\_\_\_\_/— (…)  
\_\_\_\_\_\_\_\_/— (…)

The structure for Moudle “Shared”, “ServerClientModule” and “SwingClientModule” is identical to “EJB”, all of them produce a jar.

The Result of the build process should give me a .EAR file that includes the .war and some jars from the other subprojects. But i rly cant get it work, an EAR with some basic files is simple, but i cant build a ear that includes the war an all needed JARs from the other Subprojects.

Example.EAR  
/— lib  
\_\_\_\_/— Shared.jar  
\_\_\_\_/— ClientModule.jar  
\_\_\_\_/— SomeOther.jar  
/— META-INF  
\_\_\_\_/— application.xml  
\_\_\_\_/— MANIFEST.MF  
/— EJB.jar  
/— Web.war  
\_\_\_\_/— images  
\_\_\_\_/— META-INF  
\_\_\_\_/— signedClientLibs  
\_\_\_\_\_\_\_\_/— Shared.jar  
\_\_\_\_\_\_\_\_/— ServerClientModule.jar  
\_\_\_\_\_\_\_\_/— SwingClientModule.jar  
\_\_\_\_/— WEB-INF  
\_\_\_\_/— index.jsp  
\_\_\_\_/— web\_app.dtd

Hope for some help, please 🙂

Edit: I have include in the RootProject build.gradle " deploy project(path: ‘:Web’, configuration: ‘archives’)", now i get an ear that include the war. Only the jar’s from the other Subprojects i couldnt include.
