Setup a Spring Web Application Project

Now you are ready to set up your first process application project in Eclipse in the IDE of your choice, the following description uses Eclipse.

Set Up a Java Project

We will start by setting up a Spring web application as an Apache Maven Project inside Eclipse. This consists of four steps:

  1. Create a new Maven Project in Eclipse
  2. Add the Camunda & Spring framework dependencies
  3. Add the web.xml file for bootstrapping the Spring container
  4. Add a Spring application context XML configuration file

In the following sections, we go through this process step by step.

Create a new Maven Project in Eclipse

First, we set up a new Apache Maven based project in Eclipse. Let’s call it loanapproval-spring. The screenshot below illustrates the settings we choose. As we are deploying a web application, make sure to select Packaging: war.

When you are done, click Finish. Eclipse sets up a new Maven project. The project appears in the Project Explorer view.

Add Camunda BPM & Spring Framework Dependencies

The next step consists of setting up the Maven dependencies for the new project. Maven dependencies need to be added to the pom.xml file of the project. We add both the Camunda BPM and the Spring Framework dependencies:

<project xmlns="" xmlns:xsi=""


  <!-- import Camunda BOM to ensure correct versions of Camunda projects -->



Add web.xml File for Bootstrapping the Spring Container

Next, we add a web.xml file for bootstrapping the spring container. In order to do so, first add a folder named WEB-INF to the (preexisting) src/main/webapp folder of your Maven project. Inside the src/main/webapp/WEB-INF folder, add a file named web.xml:

<web-app xmlns="" xmlns:xsi=""
          " version="3.0">




Now you can perform the first build. Select the pom.xml in the Package Explorer, perform a right-click and select Run As / Maven Install

Add a Spring Application Context XML Configuration File

Next, we add a Spring ApplicationContext XML file to the same src/main/webapp/WEB-INF folder. The file must be named applicationContext.xml. We start with an empty file:

<beans xmlns=""

Congratulations, you have completed the project setup. Your project should now look as depicted in the screenshot to the left.

You can now perform a full Maven build and deploy the project to a vanilla Apache Tomcat server. You should see the following log output:

INFO org.apache.catalina.startup.HostConfig.deployWAR
Deploying web application archive ..\webapps\loanapproval-spring-0.1.0-SNAPSHOT.war
Root WebApplicationContext: initialization started
Refreshing Root WebApplicationContext: startup date [DATE]; root of context hierarchy
INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Pre-instantiating singletons in defining beans []; root of factory hierarchy
INFO org.springframework.web.context.ContextLoader.initWebApplicationContext
Root WebApplicationContext: initialization completed in 247 ms
INFO org.apache.catalina.startup.HostConfig.deployWAR
Deployment of web application archive ..\webapps\loanapproval-spring-0.1.0-SNAPSHOT.war has finished in 1,740 ms

This means that you have set up your Spring web application correctly.

Catch up: Get the Sources of Step-1.

Download as .zip or checkout the corresponding tag with Git.

You can checkout the current state from the GitHub repository.

If you have not cloned the repository yet, please execute the following command:

git clone

To checkout the current state of the process application please execute the following command:

git checkout -f Step-1
Or download as archive from here.

On this Page: