Monday, April 1, 2013

Create a Web Application project using Maven


This post i will briefly guide you how to create a simple web Application using maven tool.

Since i am using intellij IDEA As IDE, by default the project that i am creating will be created in the "IdeaProjects" directory.

In order to demonstrate this task, i am creating a web app called SampleWebApp.

mvn archetype:create 
-DarchetypeGroupId=org.apache.maven.archetypes 
-DarchetypeArtifactId=maven-archetype-webapp 
-DarchetypeVersion=1.0 
-DgroupId=com.sample.test 
-DartifactId=SampleWebApp 
-Dversion=1.0-SNAPSHOT





As a result of running above given code snippets in the terminal or cmd, you will get bellow directory and file structure. This automated process is reducing the workload of the developer.




Now you can use your IDE to open up the projects and start coding.





for further reading about maven
[1]http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
[2]http://www.sonatype.com/books/mvnref-book/reference/