Search Tutorials

Spring MVC Tutorials | JavaInUse

Configuring the Development Environment


In this chapter we will do the project setup which will be required throughout this series.
We will be creating a Maven project with minimum dependencies added to POM for getting Spring MVC up and running.
In Future chapters further dependencies will be added to the POM.xml as and when required.

Lets Begin

For this series we will be using
1. Eclipse IDE(Luna)
2. Apache Tomcat(version 7)

We will be creating a Maven Project and also configuring Tomact in POM for deployment.
Open the Eclipse IDE.
1. Go to File->new->other->Maven Project.Click Next Button.


2. If not already selected, select Use default Location. Click Next Button.

3. Select Archtype as maven-archtype-webapp. Click Next Button.

4. Enter the values for Group Id as com.javainuse and Artifact Id as employee-management-system.

5. Click Finish

Our Maven Web Project is now created. We will now modify the pom.xml file as follows-
1. Add dependencies required for Spring MVC.
2. Add the build plugins required for maven and tomcat configurations.

After modification our pom.xml file is as follows-
<project xmlns="" xmlns:xsi=""
	<name>employee-management-system Maven Webapp</name>

Here we have configured the tomcat in the pom itself. Now run the following two Maven commands in sequence
1. clean:install - This will download the dependencies required and build the war file.
2. tomcat:run - This will start the Tomcat and install the war file in Tomcat container. In the console you will se the deployment details as follows

After running these commands open the browser and go to http://localhost:8080/employee-management-system

So our Eclipse and Tomcat are now configured. Eclipse project structure at the end of this chapter is as follows-

Download Source Code

Download it - Spring-MVC Project Setup

What Next?

In the next chapter will implement Simple MVC.