This post will explain how to Create a Maven project in Eclipse. While creating a Java project in Eclipse, Maven can be handy and used to handle the dependencies required by the project automatically with the help of ‘Project Object Model’ i.e POM file. Rather than adding required JARs externally into the project, we can simply add them into the classpath with the help of POM.

Easy & Clean presentation of #Maven project creation in Eclipse...!!! Click To Tweet

Let’s begin creating the Maven project in Eclipse:

Step 1. Access Eclipse IDE and navigate to File > New > Other… This will open a wizard window to create the Maven Project.

Create a maven proejct in eclipse_Eclipse_File_Other_Option_Techndeck

Step 2. Look for the Maven folder, expand it, and select the Maven Project and then click Next.

Create a maven proejct in eclipse_Eclipse_Maven_Project_Option_Wizard_Techndeck

Step 3. ‘Create a simple Project’ option wouldn’t be checked by default. But, in this particular tutorial, we are going to choose this option as it would help to create simple Maven-Java project. If you are looking to set up advanced settings, then don’t check this option and continue, you’ll see various advanced options. Well, as we are going by the ‘Create a simple project’ option, then click the corresponding checkbox and then click Next.

Maven_Project_NameLocation_Techndeck

Step 4. Now, you will see a new window will open to configure the project. There you need to provide some required information for the Maven project. You need to provide information about the ‘Artifact’, ‘Parent Project’ Information and some other Advanced settings. Here we are go enter information about Artifact like ‘Group Id’, ‘Artifact Id’, ‘Version’, ‘Packaging’, ‘Name’ etc. In order to get a better understanding of the naming conversions of these attributes. Please check this link.

Let’s fill the information as shown below in the screenshot and click ‘Finish’.

Configure_Maven_Project_Techndeck

Step 5. Now, you will see that your project has been created in the left panel in eclipse under ‘Project Explorer‘. There you’ll see 4 major packages, 2 holds the ‘Main Java’ code and resources which are ‘/src/main/java’ and ‘/src/main/resources’ respectively while rest 2 belongs to ‘Test Java’ code and resources which are ‘/src/main/java’ and ‘/src/main/resources’ respectively.

Eclipse_Maven_Project_Techndeck

Step 6. Let’s open the pom.xml file to see what information it is holding up. In this file, you can see the information entered in previous steps about the Project like ‘Group Id’, ‘Artifact Id’ and other information.

Eclipse_Maven_POM_TechndeckThat’s it. It’s that easy to create a maven project in eclipse. Keep Learning 🙂

Easy & Clean presentation of #Maven project creation in Eclipse...!!! Click To Tweet

 

Check out the below video to create the maven project in eclipse:

 

Do you like this Post? 🙂 – then check my other helpful posts:

Other Useful Resources: