There was an error in this gadget

Friday, March 25, 2011

How to create WAR and EAR in Eclipse

Web Tools Platform User Guide > Creating Web applications > Web projects
Importing Web archive (WAR) files

A Web Archive (WAR) file is a portable, packaged Web application that you can import into your workspace.
Before importing a WAR file, you should first determine if the WAR file contains needed Java™ source files. When importing a WAR file into an existing Web project, the imported Web deployment descriptor files are either not changed or overwritten by the ones included in the imported WAR file, based on your response to the prompt that is provided. In either case, this action does not represent a merging of the two sets of deployment descriptors.
To import the Web project resources in a WAR file into your workspace, complete the following steps:
1. Select File > Import .
2. In the Import dialog, select WAR file and then click Next .
3. Locate the WAR file that you want to import using the Browse button.
4. The wizard assumes you want to create a new Web project with the same name as the WAR file. If you accept this choice, the project will be created with the same servlet version as specified by the WAR file and in the same location. If you want to override these settings, you can click New and specify your new settings in the Dynamic Web Project wizard.
5. Click Finish to populate the Web project.





War
Web Archive – How to create a war file from Eclipse


When we have finished with a project and want to deploy it elsewhere we create a WAR file. To do this,
1. Right click on the project and select Export > WAR file
2. Update the name or keep default and enter a Destination for where the WAR file will be created
3. Click Finish and your WAR file is generated.
You can now import the War file to your test or production environments. Refer to your application server documentation for instructions on how to deploy a web application from a WAR file.
That gets us started with creating web applications. In the next article we’ll look at how to setup Eclipse to use the BusinessObjects SDK and then create a simple logon page to test that all is set up correctly.


EAR

Just copy the generated .EAR to ...\server\default\deploy folder of JBoss.

No comments:

Post a Comment