Thursday, August 11, 2011

How to create web application project using maven

today i decided to post how to create new web application project using maven. the following command should be typed in your linux vi editor for creating new project with maven. In linux terminal, go inside your project directory where the project source files should be created.then invoke the following command in the VI editor to create new project.


mvn archetype:generate -DgroupId=org.convery.example -DartifactId=SpringEmailInGmail  -DarchetypeArtifactId=maven-archetype-webapp -Dversion=1.0


the most importnat parameter can be described as belows.

-DgroupId this reffers to the Packaging path
-DartifactId this refes to the project id


once this command is executed, it will take few times to create new project. once the project is created you can see the newly created project structure as follows.

SpringEmailInGmail (as we have specified for the project name)
|------ pom.xml
|
|-------src
          |----main
                  |-----------resources
                  |
                  |-----------webapp
                                   |---------index.jsp
                             |
                                   |---------WEB-INF
                                                 |-----web.xml




hope this will helpful for you..

regards
Chathuranga Tennakoon
chathuranga.t@gmail.com

No comments:

Post a Comment