I have a several maven module (3 jar and 2 war, modules are interconnected).
My purpose is combine this modules to one ear file.
Example: in ear maven project I run in lifecycle "package" goal, when all maven project, who include in global project are execute "package" goal and when creating global ear, who include jar (war) from other maven project.
How do this?
I create global project as <packaging>pom</packaging>
, it execute "package" goal from dependency project
<modules>
<module>...</module>
</modules>
but how create ear?
You should use <packaging>ear</packaging>
instead of pom
.
It will force maven to use maven-ear-plugin on package phase (so you don't need to provide any executions of this plugin).
You could find simple example here: Maven EAR Plugin Example