3.5. Sportsclub and Red Hat JBoss Developer Studio

Sportsclub is a Maven-based project, so you can import it into JBoss Developer Studio.

Procedure 3.1. To import sportsclub into Red Hat JBoss Developer Studio

  1. Go to FileImport.
  2. In the Import window, double-click MavenExisting Maven Projects.
  3. In the Import Maven Projects window, click Browse and select sportsclub. Then select the version of Spring to use.
    Result
    The top-level pom and the module subpoms are displayed.
  4. Click Finish.
At this point, it is important to choose if you would like to have the messaging profile in the application. The messaging profile is activated by default and you can deactivate the messaging profile.

Procedure 3.2. To deactivate the messaging profile:

  1. Right-click on sportsclub-invoicing-webmvc submodule in the Project tab in the left pane.
  2. In the right-click menu, go to MavenSelect Maven Profiles.
  3. In the Select Maven profiles window, select messaging from the Available profiles list.
  4. Click Deactivate and then click OK.
There are slight differences between the context definitions that apply in various configurations, and some definitions may not be included (as is the case with the messaging profile). This means that the poms of several modules include alternative locations for web resources, which are added by Maven at build time.

Procedure 3.3. To add web resources to a project:

  1. Go to ProjectProperties.
  2. In the left pane of properties window, click Deployment Assembly and then click Add.
  3. In the New Assembly Directive window, double-click Folder and select the folder to be included in the deployment assembly.
  4. Click Finish.
  5. Click Apply and then click OK.
    Result
    The contents of the selected folder are added automatically in the document root of the application.
Depending on the selected profiles, additional directories need to be added as shown in the following table:

Table 3.1. Additional resource folders per module and profile

Module Active profile Additional folder
sportsclub-invoicing-webmvc
  • messaging
  • src/main/webapp-messaging

Note

The application activates messaging profile by default, so additional resources need to be added even if active profiles are not explicitly indicated.
The application is ready to run.
  1. On the Servers view, choose a JBoss Enterprise Application Platform 6 server.
  2. Add one of the two EAR projects:
    • sportsclub-ear
    • sportsclub-jpa-ear
  3. Start the project.