Monday, November 16, 2009

Maven Hello World(Part 1)

-->
Why Maven with Eclipse
Eclipse is an industry leader in IDE market, it is used very extensively in developing projects all around the world. Similarly, Maven is a high-level, intelligent project management, build and deployment tool provided by Apache’s software foundation group. Maven deals with application development lifecycle management. Maven–Eclipse Integration makes the development, testing, packaging and deployment process easy and fast. Maven Integration for Eclipse provides a tight integration for Maven into the IDE and avails the following
features: · It helps to launch Maven builds from within EclipseIt avails the dependency management for Eclipse build path based on Maven's pom.xml · It resolves Maven dependencies from the Eclipse workspace without installing to local Maven repository · It avails an automatic downloading of the required dependencies from the remote Maven repositories · It provides wizards for creating new Maven projects, pom.xml or to enable Maven support on plain Java project · It helps to search quickly for dependencies in Maven remote repositories · It quickly fixes in the Java editor for looking up required dependencies/jars by the class or package name. What do you Need? 1. Get the Eclipse Development Environment : In this tutorial we are using the SpringSource Tool Suite .This tool based on eclipse and maven is integrate with this , so no need to download or configure maven with eclipse , which can be downloaded from http://www.springsource.com/products/springsource-tool-suite-download Download and Install Eclipse First download and install the SpringSource Tool Suite on your development machine . Steps to create maven web project 1.Open eclipse IDE and go to File->New-> Other.. as shown in Figure 1 below:

1. Select maven ->maven project as shown in Figure 2 below: Click next->next-> in Filter field type 'webapp' and select group id org.apache.maven.archetypes as shown in Figure 3 below: Click next-> give group id name 'com.testmaven' and artifact ' hello' ,other option remain default as shown in Figure 4 below: Click finish . Select Project hello and run on server select springsource dm server and click finish (you can add any server such as tomcat by manually define a new server) Now you can see Hello World out put in the browser