A Maven project carries its build definition with its source code. On a Linux desktop, IntelliJ IDEA can import the project from that definition and make its libraries available to the module.

The root pom.xml identifies the module and declares the dependencies it needs. During the first sync, IntelliJ IDEA reads that file and Maven fetches missing artifacts from the project's repositories.

Project trust matters because opening a project can execute code from its build configuration. IntelliJ IDEA can preview unfamiliar source in Safe Mode, where Maven import is disabled.

Steps to import a Maven project into IntelliJ IDEA:

Start from the Linux app grid with IntelliJ IDEA visible and no project open. Have a trusted local Maven project with one module, a root pom.xml, a declared dependency, and access to the repositories it uses. The Maven tool window becomes available after the import.

  1. Open IntelliJ IDEA from the app grid.
  2. Click Open under Projects and Files on IntelliJ IDEA Home.
  3. Enter the full path to your project's root pom.xml in the Open File or Project location field, replacing any existing value.

    The pictured project uses /home/reader/IdeaProjects/reading-list/pom.xml.

  4. Click OK in Open File or Project.
  5. Choose Open as Project in the Open Project dialog.

    Trusting a project lets IntelliJ IDEA run code from its build configuration. The folder-wide trust checkbox should stay clear so the decision applies only to the selected project. If the dialog names a different project or you are unsure of its source, choose Don't Open.

  6. Click Trust Project if the trust dialog names the project you selected and you trust its source.
  7. Wait for the Maven import progress indicator to clear from the status bar.

    If the editor shows Air or Junie offers, they can stay on screen while you continue to the Maven tool window.

  8. Click the Maven icon on the right sidebar.
  9. Expand your project's module in the Maven tool window.
  10. Expand Dependencies under the module.
  11. Drag the left edge of the Maven tool window left if the dependency coordinates are cut off.
  12. Verify that your module's Dependencies tree lists the coordinate from your pom.xml as a resolved entry.

    A red underline marks an unresolved dependency. The reading-list module shows org.apache.commons:commons-lang3:3.17.0 in regular text.

Share this guide