How to add a WAR file into an existent EAR file?

2019-03-02 11:11发布

问题:

Could someone explain to me how to add a WAR file into an EAR? I have one EAR file that already contains one WAR file, i have another WAR file that i would like to add to this EAR so it can contain both WARs and works properly.

I don't know how to this but i think is possible to do it manually changing the application.xml file which is included into the EAR.

Thanks!

回答1:

Assuming that the EAR file doesn't already contain the WAR file, you can use common zip utilities to add the WAR file within the EAR file.

Note that this won't update any of the EAR file descriptors. To update the descriptor, you'll need to add a new web module directive.