Today I want to talk about Maven. It’s very powerful instrument and if you know how to use it you will make minimum effort to achieve maximum result. In general Maven helps you to manage a project including library dependencies, building process and etc…apacheMaven - Crunchifiy

Here is a simple tutorial which you can go through to create Dynamic Web Project having Maven enabled in Eclipse. This project can be used as base project and can be easily converted to most kind of advanced Java project like Spring MVC based etc. How to create a Web Application Project with Maven?

Tools I’m using:

  • Eclipse EE
  • Maven
  • JSK 1.7
  • M2Eclipse Plugin


You have setup Maven and Apache Tomcat Server successfully in your Eclipse Environment.


Create a simple maven Project in Eclipse.

Create Simple Maven Project in Eclipse


Select default Workspace location

Use Default Workspace Location


Select the maven archetype as: maven-archetype-webapp and click on next.

Select maven-archetype-webapp


Fill out below details and click Finish. This step creates Maven Project in your EclipseEnvironment.

Create Crunchify Maven Project in Eclipse


If you see error “The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path index.jsp /CrunchifyMavenTutorial/src/main/webapp” then add below maven dependency.

OR add Apache Tomcat to your Targeted Runtimes.

HTTPServlet Error? Add Target Runtime

Targeted Runtime - Apache Tomcat


Your Maven Project should look like this.

CrunchifyMavenTutorial Eclipse Structure


Now build project with “Maven Clean Install” to check there isn’t any dependency issue with project. Crunchify - Maven-RunAs-MavenBuild...

Maven Clean Install in Eclipse

Maven Build Successmessage in Eclipse Console


Deploy Application on Apache Tomcat Server.


  • Right click on Server -> Add and Remove -> Select CrunchifyMavenTutorial -> Click Finish.
  • Start tomcat server.


Visit http://localhost:8080/CrunchifyMavenTutorial/index.jsp to see your result.

CrunchifyMavenTutorial Web Result

And you are all set.

Leave a Reply