JBoss.orgCommunity Documentation
Starting from 3.1 M2 version JBoss Tools includes new Jboss Maven Integration plug-in which for now allows to create mavenized Seam projects and enable Seam tools support for imported Maven projects.
The Jboss Maven Integration requires m2eclipse to be installed.
For M2 release of Jboss Tools it is important to use m2eclipse stable updatesite or the latest integration build that M2 was developed against. If you want to use the latest development release of m2eclipse you need to use the nightly builds of JBoss Tools.
Maven Integration makes the Seam Wizard capable of creating Maven ready projects to let Maven get the libraries instead of using the Seam runtime.
To create a mavenized Seam project you should perform the following steps:
Navigate to File > New Seam Project. Give the project a meaningful name, specify a target runtime and server and select the proper configuration for your Seam project:
Click the Modify button to enable the Jboss Maven Integration facet:
On the JBoss M2 capabilities page you'll be prompted to add the following maven properties: groupId, artifactId, version, packaging, name and description. Here it's possible to set a maven version of Seam and also decide whether to remove WTP classpath containers (where the path starts with org.eclipse.jst).
On the JSF Capabilities page you can choose Maven as libraries provider. This is possible when you use Maven JSF 1.2 Libraries as type of JSF Implementing Library. Also it gives you capability to edit Dependencies and Exclusions for the mavenized Seam project directly from the wizard.
On the Seam Facet page configure the Seam Facet settings and click Finish:
The organized Seam project contains five projects with the Maven nature, builder, Maven classpath and the pom.xml files added: projectname, projectname-ear, projectname-ejb, projectname-parent and projectname-test.
Maven Integration includes the Seam Maven configurator which is called when importing a project, changing pom.xml and/or calling Maven > Update Project Configuration. When importing a Maven Seam project, the Seam Maven configurator picks up the settings set up in pom.xml and adds to the project the following:
Seam nature
Seam facet and dependent facets to the EJB, EAR and WAR projects
JBoss Maven Integration facet if the Maven project contains a dependency with the org.jboss.seam groupId and an artifactId starting with 'jboss-seam'
other required facets (Web Module, Java, JSF, etc.)
If the Seam version from pom.xml matches a version of a Seam runtime configured in the workspace, Seam configurator will set that runtime, otherwise no Seam runtime will be set and you'll have to set it manually under Seam Settings in the project preferences.
Seam configurator recognizes the Seam artifacts in the following way: the view folder is a web content folder from the WAR project, the source folder is the first Eclipse source folder. If there is a folder containing "hot" in the name, it will be chosen as the action source folder. Package is the first package that has children or doesn't have any subpackage.
Configuring the Seam when importing a Maven project as well as a Seam Runtime, Seam artifacts and some facets could be suspended in the JBoss Maven Integration preferences ( Window > Preferences > JBoss Tools > JBoss Maven Integration).
In the Using Maven with JBoss Tools article written by Max Andersen you'll find references to the screencasts on how to use the examples of mavenized Seam projects provided by JBoss Tools.