You can include the contents of another ear file in your second ear file by specifying the first ear file als dependency, but using <type>pom</type>
instead of ear
:
if you specify an ear dependency, transitive dependencies are not resolved (ear is defined as a container type). If you use pom instead, all dependencies of your first ear are (transitive) dependencies to the second ear, and thus included.