1

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!

Israelm
  • 1,607
  • 3
  • 23
  • 28

1 Answers1

5

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.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138
  • ok, so i can change the .ear by .zip and add manually the new war file into it, but how should i set up the descriptor? i am not familiar with the ear descriptor. i appreacite your help. – Israelm Sep 10 '12 at 17:45
  • http://stackoverflow.com/questions/2220891/how-to-i-have-two-war-files-within-one-ear-file should give you a start. If you don't have a war file in the ear file already, just add a new web module directive. – Edwin Buck Sep 10 '12 at 17:50
  • Glad to hear of your success. Most of the packed types in java, "jar files", "war files", "ear files" are actually zip files, with certain additional restrictions (MANIFEST.MF added first, required files in certain locations, etc). – Edwin Buck Sep 11 '12 at 19:19