JBoss EAP 5 Multi-Module Maven Project Structures

This is a set of multi-module maven project layouts for a JBoss Enterprise Application Platform 5 application that includes EJB, REST (JAX-RS), and WS (SOAP) services.

Beginner

The basic layout includes standard modules to generate an EJB jar, a WAR, and an EAR. A parent module is used for inherited properties and dependencies.

The *-api module contains a service model. Note that it is not a persistence model.

The *-services project will contain a session bean with JAX-WS annotations, its remote interface, and its local interface with JAX-RS annotations along with a persistence model (entity beans) and factories for converting persistence model beans to service model beans.

Note that because an EAR is generated, the *-rest project generates a ‘naked’ WAR. It will not have libraries. It will not have a lib folder. It will not have classes. It will have a web.xml file that configures the ResteasyBootstrap listener and the HttpServletDispatcher servlet.

The RESTEasy dependencies should be added to the *-app project. That project should be configured to place its jar dependencies in the lib folder of the generated EAR.

  • * (POM)
    • *-api
    • *-app (EAR)
    • *-parent (POM)
    • *-rest (WAR)
    • *-services (EJB, Arquillian Integration Tests)

Intermediate

Client modules with integration tests for each type of service invocation.

Note that the *-app module can be configured to generated an EJB client jar.

Note that cxf-java2ws-plugin and cxf-codegen-plugin can be used to generate a WS client using a JAX-WS annotated class.

  • * (POM)
    • *-api
    • *-app (EAR)
    • *-ejb-client (Integration Tests)
    • *-parent (POM)
    • *-rest (WAR)
    • *-rest-client (Integration Tests)
    • *-services (EJB, Arquillian Integration Tests)
    • *-ws-client (Integration Tests)

Advanced

Test and test configuration modules. Client test configuration modules for each type of service invocation.

The *-test module contains classes to get test configuration properties. The *-test-config module contains default properties files.

The *-{ejb|rest|ws}-client-test-config modules contain default properties files for client specific test configuration properties.

Note that resource filtering should be configured so that property values are in the POM to support profile specific test configuration properties.

  • * (POM)
    • *-api
    • *-app (EAR)
    • *-ejb-client (Integration Tests)
    • *-ejb-client-test-config
    • *-parent (POM)
    • *-rest (WAR)
    • *-rest-client (Integration Tests)
    • *-rest-client-test-config
    • *-services (EJB, Arquillian Integration Tests)
    • *-test
    • *-test-config
    • *-ws-client (Integration Tests)
    • *-ws-client-test-config

Complete Advanced

Performance testing modules.

The *-client-test-perf module contains performance test configuration and executes performance tests.

The *-client-test-dist module generates a zip file that contains all of the required dependencies for executing performance tests. However, the test and client test configuration modules are excluded.

  • * (POM)
    • *-api
    • *-app (EAR)
    • *-client-test-dist
    • *-client-test-perf
    • *-ejb-client (Integration Tests)
    • *-ejb-client-test-config
    • *-parent (POM)
    • *-rest (WAR)
    • *-rest-client (Integration Tests)
    • *-rest-client-test-config
    • *-services (EJB, Arquillian Integration Tests)
    • *-test
    • *-test-config
    • *-ws-client (Integration Tests)
    • *-ws-client-test-config

Ultimate Advanced

Add the RESTEasy fix.

  • *-api
    • *-app (EAR)
    • *-client-test-dist
    • *-client-test-perf
    • *-ejb-client (Integration Tests)
    • *-ejb-client-test-config
    • *-parent (POM)
    • *-rest (WAR)
    • *-rest-client (Integration Tests)
    • *-rest-client-test-config
    • *-resteasy-jaxrs
    • *-services (EJB, Arquillian Integration Tests)
    • *-test
    • *-test-config
    • *-ws-client (Integration Tests)
    • *-ws-client-test-config

</post>

JBoss EAP 5 & Maven

  • JBoss Maven Java EE 5 Dependencies (link)
  • Configuring the Maven Ear Plugin for JBoss EAP 5 (link)
  • Integration Testing w/ Maven, Cargo, & JBoss EAP 5 (link)
  • Integration Testing w/ Maven, Arquillian, & JBoss EAP 5 (link)
  • JBoss EAP 5 Multi-Module Maven Project Structures
  • JBoss Trading – Multi Module JBoss EAP 5 Project (link)
, , , ,

About Shane K Johnson

Technical Marketing Manager, Red Hat Inc.

View all posts by Shane K Johnson

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: