Maven - Creating Servlet based project by using maven-archetype-webapp

[Last Updated: Mar 14, 2017]

In this tutorial we are going to learn how to create Web Application from command line. We are going to use Maven Archtype plugin maven-archetype-webapp

The general syntax to achieve that is:

   mvn archetype:generate

  1. Open cmd.exe window and go to the location you want to create the project
  2. Run the commandObject:
        mvn archetype:generate -DgroupId=com.logicbig  -DartifactId=my-first-webapp
            -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
  3. That's it, import the new web based project to your IDE and start developing your project.

Example Project

Dependencies and Technologies Used:

  • JUnit 3.8.1: JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java.
  • JDK 1.8
  • Maven 3.0.4

Maven Webapp Select All Download
  • maven-webapp
    • src
      • main
        • webapp
          • WEB-INF
    • pom.xml

    See Also