Archetype for Seam project with JBoss Tools support.

The purpose of this project is to provide a Maven Archetype that can be used to start a Seam project using Maven. In addition, it provides an Eclipse project configured to work with the JBoss Tools feature.

Prerequisites are:

Usage

To use this archetype follow the steps below to setup a Maven and Eclipse (JBoss Tools) project.

Step 1 -- Maven project generation.

Use the following command to generate a project using this archetype:

mvn archetype:generate
        -DarchetypeRepository=http://mojo.os.xebia.com/snapshot-repo/
        -DarchetypeGroupId=com.xebia.archetype
        -DarchetypeArtifactId=seam-jboss-tools-archetype
        -DarchetypeVersion=1.0-SNAPSHOT

Always specify the correct archetypeGroupId, archetypeArtifactId and archetypeVersion with the corresponding archetypeRepository:

Step 2 -- Generating the Eclipse projects.

After generating the Maven projects, browse to the directory in which they were created and execute the following command:

  mvn install eclipse:m2eclipse

It is necessary to issue an install here, since the projects depend on each other and the build will not succeed if a the installed archetypes are not found.

Step 3 -- Import the projects into an Eclipse workspace.

Open an Eclipse workspace and import the projects. Starting from the directory in which the project was created there should be three Eclipse projects found.

Projects to Import

Step 4 -- Adjust the Seam configuration for WAR project.

After the projects have been imported, changes the Seam configuration for the WAR project, by going to the properties page of this project and selection the "Seam Settings" page. The Seam Runtime needs to be configured.

Seam configuration

Step 5 -- Update the Eclipse project using the M2 Eclipse plugin.

Update *the EAR project* using the M2 Eclipse plugin.

M2 Eclipse execution.

It is important to just update the EAR plugin.

Step 6 -- Deploy the EAR project on a server inside Eclipse.

After you deploy the EAR project on a Server, you can develop the application using Eclipse and WTP as you normally would.

Known Issues

There are a couple of known issues with this approach:

  1. The connection between the EJB project and the WAR project is not recognized by JBoss Tools.

    When creating a new Seam Artifact (Entity/Form/Action/Conversation/...) from the EJB project, the Seam configuration is not picked up. Workaround is to always create the Artifact from the WAR project. This will still put the code in the EJB project when necessary.

  2. When the project is created, Velocity (in Maven) complains about a variable reference that is not set (${pom.version}).

    This is on purpose: The ${pom.version} should remain in the pom's to ensure that the dependencies are updated as the project is released.