How to import all Spring MVC Dependencies to your Maven Project?

Spring MVC Basic Maven Dependencies - Crunchify Tips

Are you starting with your first Spring MVC example and wondering how to include all Spring MVC dependencies into your project?

Sometime back I’ve written a complete article on HelloWorld Spring MVC tutorial. It is THE complete Java tutorial available for you to use. While working with some of my friends and users, I came to know that it would be also handy to identify how many Spring MVC .jar files do they have to import into project? In other words, how many maven dependencies if it’s maven project.

Let’s get started:

Step-1

In Eclipse, click on

  1. File
  2. New
  3. Maven Project

Start Creating new Maven Project inside Eclipse

Step-2

Choose default Workspace location

New Maven Project - Use Default Workspace Location

Step-3

  • Select Group Id: org.apache.maven.archetypes.

select org.apache.maven.archetypes

Step-4

  • Provide Group Id: crunchify.com
  • Provide Artifact Id: CrunchifyFirstSpringMvcExample
  • Click on Finish

Group ID and Artifact ID for Maven Project

Step-5

You should see your maven project into Eclipse now.

First Sample Maven Project

Step-6

As maven project comes with default junit dependency you just have to include Spring MVC related dependencies. Open pom.xml file and add below dependencies.

Now you are all set with your first Spring MVC project.

Have anything to add to this article? Please chime in and join the conversion.