Maven Eclipse Example

Maven eclipse for beginners and professionals with topics on maven example, plugin, pom, dependency, eclipse, repository, web application, eclipse example, servlet, jsp, struts, hibernate, spring etc.

Maven Eclipse Example

Maven Eclipse Example

Maven eclipse tutorial explains how to create maven example in eclipse.

In eclipse, click on File menu → New → Project → Maven → Maven Project. → Next → Next → Next. Now write the group Id, artifact Id, Package as shown in below figure → finish.

Now you will see a maven project with complete directory structure. All the files will be created automatically such as Hello Java file, pom.xml file, test case file etc. The directory structure of the maven project is shown in the below figure.

Now you can see the code of App.java file and run it. It will be like the given code:

  1. package com.point;  
  2. /** 
  3.  * Hello world! 
  4.  * 
  5.  */  
  6. public class App   
  7. {  
  8.     public static void main( String[] args )  
  9.     {  
  10.         System.out.println( "Hello World!" );  
  11.     }  
  12. }  

If you right click on the project → Run As, you will see the maven options to build the project.