Creating A New Maven Project Using ECLIPSE


Maven in a popular build automation tool for Java projects. It is a widely accepted standard for building Java projects. This article demonstrates how to create a New Maven Project using Eclipse.


Step 1

To create a Maven Project in Eclipse, we must have Maven Integration Plugin installed in Eclipse. If you have the plugin installed skip to Step 2. 

If Maven plugin in not installed, we can install it from the 'Eclipse Marketplace'. To open Eclipse Marketplace, go to Help Menu and click on 'Eclipse Marketplace' (Help --> Eclipse Marketplace). We can search for plugin and install it from the marketplace.

The image below shows the plugin for Eclipse Luna. Make sure you install the plugin for the correct version of eclipse you are using.

Maven Plugin Marketplace

Step 2

To create a New Maven Project in Eclipse go to File --> New Maven --> Project as shown in the image below:

New Maven Project

In case Maven Project is not available under File --> New, you can find it in Other. Clicking on 'Other' will open the following window, where we can search for maven:

New Maven Project Other Option

Step 3

At the end of step 1 we will end up in the ‘New Maven Project’ Wizard. Here we will first see a window as shown below:

New Maven Project Wizard

Maven comes with various archetypes. A Maven Archetype is a simple artifact that contains a project template. It helps Java developers by automatically generating a project skeleton. We can skip this option of archetype selection by checking the 'Create a simple project' option.

Shown below is the archetype selection window. We can select the appropriate archetype we want for our project. For example, to create a Java web application we can select the 'maven-archetype-webapp'.

New Maven Project Archetype Selection

Every maven project should have a group id, an artifact id and a version. We can enter this information in the next window as shown below:

New Maven Project Archetype Selection

Finally we can click on the Finish button to create a new maven project.