Exporting an enterprise application into an EAR file
Complete the following steps to export an EAR file:
Switch to the J2EE perspective.
From the File menu, select Export...
Select the EAR file export wizard and click Next.
Select the EAR project that you want to export.
Select the location where you want to export.
Specify additional options as appropriate using the Options check boxes.
To export source files, select Export source files.
If you are exporting to an existing JAR file and you do not want to be warned about overwriting it, select Overwrite existing files without warning.
To include build path information and metadata files, select Include project build paths and meta-data files. This allows you to preserve the original names of projects included in or referenced by the application project, for re-importing the EAR in another workspace. NOTE, however, that on re-import, binary projects will be created if this option is used.
The wizard exports the contents of the EAR project to the specified EAR file. Additionally, for each project that corresponds to a module or utility JAR in the application, the project contents are exported into a nested module or JAR file in the EAR file. If any unsaved changes exist on any of the files in any of the referenced projects, you will be prompted to save these files prior to export.
Exporting Web Archive (WAR) files
A Web archive (WAR) file is a packaged Web application that can be exported to test, publish, and deploy the resources developed within a Web project.
To export WAR file from a Web project, do the following:
From the context menu of a Web project folder, select Export.... You can alternatively select menu File > Export...
Select the WAR file export wizard and click Next.
Specify the Web project you wish to export (this field is primed if you used the context menu to launch the wizard), and specify a location for the new WAR file.
Optionally, supply WAR export Options, such as whether or not to include Java source files in the WAR, and whether to overwrite any existing resources during the export process.
NOTE: Source files are not usually included in a WAR file, because they are not necessary for the server to run the web application.