Maven project for creating Spring web applications deployable on Websphere

Table of contents:

  1. Introduction
  2. Maven project structure
  3. Source code


This article describes how to create Spring web application that can be deployed on WebSphere application server. The goal is to to create maven project that can be used to generate EAR file.

Maven project structure

The following list shows the multi-module maven project directory structure:

|- websphere-maven-spring-project 
|-- app-ear/
|---- pom.xml
|-- app-webapp/
|---- src/
|---- .classpath
|---- pom.xml
|- pom.xml

The project consists of one parent / aggregator module and two sub/child modules. For more information on multi-module please go to maven documentation website.

Aggregator module

Aggregator is a top-level module used to join multiple modules.

The following is an excerpt from aggregator pom.xml:



Both sub-modules (app-ear and app-webapp) must include reference to the parent module as follows:


Sub-module: app-ear

WAR module (app-webapp) needs to be included in the list of EAR dependencies.


Include maven-ear-plugin in the build plugins section of the app-ear pom.xml:



Sub-module: app-webapp

Web app module is an simple web application generated with the spring initializr.

Source code

You can clone entire project from the following github repository.

← Home