How to create a Maven Project in Eclipse?

Share:
Eclipse IDE has excellent support for the Maven, We can create a Maven Project easily in Eclipse by just following some steps.

Today we will see How to create a Maven Project in eclipse, below are the steps for creating a Maven Project in eclipse.

1. Just click on the File -> New -> Other... to open the Wizard dialog.



2Now find the Maven Project under Maven folder and click on the Next.


3. We are just creating a simple project here then we will check the Create Simple Project and forgo the other options and click on next. We will see the use of other options in our next later Post.


4. Now you need to fill the details for your Maven Project you are creating, Here you will see Group Id, in generally group id is the name of organization, And artifact Id means the name of the Project, You may leave the Parent Section if you are creating a stand-alone project and have not any parent project dependencies. You may visit Maven documentation if you want to know more about this.


5. Now after finishing your project creation, You will notice maven created some folders for your Project, You will place your java files under /src/main/java folder, resources /src/main/resources, and your testing files and resources in  /src/test/java and /src/test/resources respectively.


6. Open the pom.xml file to view the structure of your maven project, In this file, you can see the details you entered in Step 4. You may also use the tabs at the bottom of the window to change to view Dependencies, the Dependency Hierarchy, the Effective POM, and the raw XML code for the pom file in the pom.xml tab.



Now you have a Java Project with Maven enabled.

1 comment:

Post your comment.