A Java project's build settings and dependencies travel with its pom.xml. On the Linux desktop, Eclipse can import an existing Maven project and use that file to set up the Java build path.

Eclipse can work with the project in its existing folder. The import adds Eclipse project metadata alongside the source files.

The first import may download libraries and Maven plugins from the project's repositories. A shared project can therefore need repository access as well as a compatible JDK.

Steps to import a Maven project in Eclipse:

Start with a folder containing one Maven project and a single pom.xml that declares at least one dependency. In the open Eclipse IDE for Enterprise Java and Web Developers workspace, Project > Build Automatically is on, Project Explorer and Problems are open, and Problems uses its default filter.

If Eclipse shows Install Java 27 Support, the choice depends on your project. Remind Me Later dismisses the notice so you can continue with File.

  1. Open File on the Eclipse menu bar.
  2. Select Import… from the File menu.
  3. Expand Maven if the category is collapsed.
  4. Select Existing Maven Projects if it is unselected.
  5. Click Next > in the Import wizard.
  6. Enter the project folder in Root Directory, replacing any existing value.

    The sample project is hello-maven in /home/reader/Documents/hello-maven.

  7. Click Refresh to scan the folder for Maven projects.

    The wizard checks the sample project's pom.xml under Projects.

    Eclipse can run Maven plugins during workspace builds. Do not import the project if you cannot verify that it and its plugins come from sources you trust.

  8. Click Finish when your project's pom.xml is the only checked entry under Projects.
  9. Wait until the progress indicator in the status bar disappears.
  10. Expand the imported project in Project Explorer.
  11. Drag the right divider of Project Explorer to the right if the project entries are clipped.
  12. Expand Maven Dependencies.
  13. Verify that a dependency declared in pom.xml appears under Maven Dependencies.

    The sample project's dependency appears as commons-lang3-3.20.0.jar.

  14. Click the Problems tab.
  15. Drag the top divider of Problems upward if its list is hidden.
  16. Expand Errors in Problems if the group is collapsed.
  17. Confirm that no missing dependency or Java build-path error in Problems names your imported project in Resource or Path.

    With no errors, Problems shows 0 errors and may show no Errors group. The sample has one XML schema warning for pom.xml.

Share this guide