JBoss.orgCommunity Documentation

Chapter 4. Directory Structure of the Generated Project

4.1. WAR Deployment
4.2. EAR Deployment
4.3. Changing the Seam Version
4.4. Changing Seam Parent Project
4.5. Renaming the Projects and Folders

In this chapter we describe where the Seam wizard puts the generated files for both EAR and WAR deployments.

The Seam Project wizard generates projects like Eclipse WTP style in order to utilize Eclipse WTP features and to have a correct classpath. To be more precise it generates one project per artifact.

The project layout for WAR projects is:


A WAR project can only use Seam JavaBean and JPA Entity bean components; it cannot use EJB3 Session beans etc.

WAR projects are generated to enable Seam war hotdeploy feature. Classes put into src/action will be deployed to WEB-INF/dev from which Seam automatically will perform hotdeploy of new components.

Note:

Because of Eclipse WTP limits the hot deployed classes also existed in WEB-INF/classes, but since Seam gives WEB-INF/dev precedence it will work.

Furthermore the Seam Project wizard generates a test project that is setup to run directly against the proper libraries and server runtime libraries. You can run tests via Run AsTestNG Test.: Chapter 15, What is TestNG?.

In order to deploy WAR project on server, right-click on the project and select Run AsRun on Server. Studio will deploy WAR project into one web application on server to deploy folder.

The project layout for EAR projects is:


An EAR project can use the whole range of Seam components, including EJB3 Session beans.

In order to deploy EAR project on server, right-click on the project with -ear postfix and select Run AsRun on Server. Studio will take care about all modules and deploy EAR project into one enterprise application on server to deploy folder. EAR application keeps ejb and war modules of the EAR project.

Note:

The WAR generated for EARs is now configured to utilize Seam hot-deployment (WEB-INF/dev) similar to standalone WAR projects.

To upgrade or downgrade your projects Seam version use the facet preferences. You should right-click your project, open its Properties and choose Project Facets category. Next select Seam and change its version to needed one.


After pressing Apply the wizard for adjusting new Seam runtime settings appears.


If you need to update the libraries for you project, check the Update libraries option. All libraries you checked will be removed and the libraries from the new Seam distribution will be added after clicking Ok.


Note:

The note "Seam configuration files and their XSDs won't be changed" is meant that the libraries, Seam facet and runtime version will be changed, but configuration files that refer to the old version will have to be manually updated.

To change the Seam parent project, navigate to your project preferences and select Seam Settings category on the left. Press the Browse button next to the Main Seam Project section to select the other Seam parent project.


If you need to rename one of the Seam Project artifacts (<project_name>, <project_name>-ear, <project_name>-ejb or <project_name>-test) or any entire folder like <project_name>/WebContent, <project_name>/ejbModule, <project_name>-test/test-src, or project name in packages org.domain.<project_name>.session, org.domain.<project_name>.entity, you can do this by accessing the context menu and navigating to Refactor > Rename... or just pressing Shift + Alt + R under the chosen resource.


Use Refactor > Move... (or Shift + Alt + V ), if you need to move <project_name>/WebContent folder, <project_name>/ejbModule folder or <project_name>/test-src folder in the other place within the Project structure.