This is a step by step guide on, How to import an existing maven project into eclipse using most common approach.
Latest eclipse comes with pre-configured Maven plugin, most of the cases there are no additional settings required. There are different types of maven options to import. In this tutorial I am going to explain about importing existing Maven project.
1. Import maven project into eclipse
- Before import maven project into eclipse, make sure you already have a maven project in your workspace or system.
- In your eclipse IDE, Click on File option OR right click on Project explorer –> Select “Import” –> Select “Import”. Follow below screen.
- Select “Existing Maven Projects” –> Click on “Next”.
- Click on Brows button -> Browse your project from work space –> Click on “Finish”. Your maven project will be imported, you can see in Project Explorer.
- Verify that pom.xml is available for the project you are going to import in Maven Projects window, select the check box if it is not already selected.
2. Build Maven Project
- Right click on imported Project –> select “Run As” –> select “Maven build” (2nd option, first option triggers recently used goals for build)
- Enter goals “clean install” –> click on “Run”
- You can see in console for build status, If the build is succeeded, the build status should be “SUCCESS” .
In this step by step guide we have seen how to import maven project into your IDE. There are other ways too, this is most recommended approach.
Other Maven Setups:
- Install Maven on Windows
- Install Maven on Ubuntu
- Install Maven on Mac
- Maven Skip Tests
- Maven run single test
- Maven set java version
- Maven run java main class