HomeMavenHow to import maven project into eclipse

How to import maven project into eclipse

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.
import maven project into eclipse
  • Select “Existing Maven Projects” –> Click on “Next”.
select existing maven project
  • 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.
browse existing maven project into eclipse

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)
build maven project in eclipse
  • 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” .
maven clean install in eclipse

Output :

eclipse console results

3. Conclusion

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:

  1. Install Maven on Windows
  2. Install Maven on Ubuntu
  3. Install Maven on Mac
  4. Maven Skip Tests
  5. Maven run single test
  6. Maven set java version
  7. Maven run java main class

4. References

  1. Eclipse bug on import project
  2. Apache Maven

LEAVE A REPLY

Please enter your comment!
Please enter your name here