Seam projects in IDEA
This document describes how the IDEA project can be configured to deploy the Seam applications to JBoss. One of Seam sample projects - Booking sample - is considered.
1) Create the new IDEA project from existing sources - seam booking example.
2) Create module libraries to include to deployed archives:
- jboss-seam.jar should be put to the ear file
- 'to_war' library: jars that should appear in the WEB-INF/lib folder of war
- 'to_ear' library: jars that should appear in the lib folder of ear
- Jars not included to deployment: jsf-api.jar, hibernate*.jar
1) Adjust the facets detected in project:
Add additional resources: persistence.xml file to META-INF folder of deployment root, import.sql and seam.properties files - to deployment root.
Select to_ear library to link via manifest and copy files to /lib; select jboss-seam.jar to link via manifest and copy to /.
Add additional resources: components.xml, faces-config.xml, pages.xml to WEB-INF, messages.properties - to WEB-INF/classes.
Select library to package into war: to_war library should be copied to /WEB_INF/lib. Set the web resource directory - view folder.
Include EJB and Web facets into ear; set the context root and module names properly. Add jboss-app.xml as additional resource.Note that the application.xml is changed on facet configuring and the duplicated modules are inserted there; remove them manually from this file after configuring the facet.
On the build settings tab set the archive name to deploy or the exploded directory (note, that it should have .ear extension):
Remove JPA facet to avoid redundant resources packaging into war.
4) Edit the components.xml :
The core:init component should be changed as follows:
5) Create JBoss run configuration:
select the jboss application server, default instance; on the Deployment page select the facet to deploy - javaEEApplication facet.
That's all. The ear that is created on deployment is the same as one built by ant in the original seam example.