# Maven projects

IntelliJ IDEA lets you manage [Maven](https://maven.apache.org) projects. You can [link](#link_unlink_maven_project), ignore projects, synchronize changes in Maven and IntelliJ IDEA projects, and configure the build and run actions.

Procedure: Navigate to POM

1. In the [Maven](maven-projects-tool-window.html) tool window, right-click a linked project.

2. From the context menu, select Jump to Source `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (NetBeans), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F12` (Eclipse), `F3` (Eclipse (macOS)).

IntelliJ IDEA navigates to the appropriate Maven configuration file, and the related POM opens in the editor.

Procedure: Ignore a Maven project

You can deactivate a Maven project using the Ignore Projects option. In this case, IntelliJ IDEA keeps the ignored Maven projects and subprojects in the Maven tool window, but stops their import (modules, content roots, goals, and so on) to the project. However, IntelliJ IDEA synchronizes the ignored projects with the current one. It might be helpful when you work with a project that has multiple subprojects and need to skip irrelevant ones.

> **Note:**
> If you ignore a project on which the other subproject depends on, then the ignored project changes to a library. If such a library is not found in the Maven repository, it will be colored in red. To add this library to a repository, in the Maven tool window, open the ignored project node and in the Lifecycle, run the `install` command.

1. In the [Maven](maven-projects-tool-window.html) tool window, right-click the project that you want to ignore.

2. From the context menu, select Ignore Project.

> **Note:**
> Alternatively, you can use the Project tool window or the Project Structure dialog to remove a subproject to make it ignored.

3. In the window that opens, click Yes if you want to remove the project from the Projects tool window.

If you want to activate your Maven projects or subprojects, select Unignore Projects from the context menu.

Procedure: Ignore POM of a linked project from the Maven settings

You can ignore a POM file using the Ignored Files settings.

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))) , go to `Build, Execution, Deployment | Build Tools | Maven | Ignored Files`.

2. On the Ignored Files page, select a POM you want to ignore and click OK to save the changes.

![Maven Settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/maven_settings_ignored_files.png)

3. IntelliJ IDEA displays an ignored file in the Maven tool window and in the Project tool window.

If you keep the ignored file in the Project tool window, the POM will be displayed as ignored, however, you can still work with the file and modify it in the editor.

![Project tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/project_tool_window_ignored_file.png)

Procedure: Sync a Maven project

Every time you manually change the `pom.xml` file in the editor, you need to synchronize the changes. IntelliJ IDEA displays a notification icon in the right part of the editor suggesting to Sync Maven Changes made to the project (`Ctrl+Shift+O` (Windows), `Ctrl+Shift+O` (macOS), `Ctrl+Shift+O` (IntelliJ IDEA Classic (macOS)), `Ctrl+Shift+O` (macOS System Shortcuts), `Ctrl+Shift+O` (XWin), `Ctrl+Shift+O` (GNOME), `Ctrl+Shift+O` (KDE), `Ctrl+Shift+O` (Emacs), `Ctrl+Shift+O` (Sublime Text), `Ctrl+Shift+O` (Sublime Text (macOS)), `Ctrl+Shift+O` (NetBeans), `Ctrl+Shift+O` (Visual Studio), `Ctrl+Shift+O` (Visual Studio (macOS)), `Ctrl+Shift+O` (Eclipse), `Ctrl+Shift+O` (Eclipse (macOS))).

If you want to control the importing process of your project, you can manually trigger the action.

> **Note:**
> IntelliJ IDEA does not resolve dependencies for the excluded POM files during the reload process.

1. In the [Maven](maven-projects-tool-window.html) tool window, right-click a linked project.

2. From the context menu, select Sync Project ![the Sync project icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.refresh.svg).

On invoking this action, IntelliJ IDEA parses the project structure in the Maven tool window.

IntelliJ IDEA reloads only the changed part of your project.

If you configure a dependency through the Project Structure dialog (`Ctrl+Alt+Shift+S` (Windows), `⌘ ;` (macOS), `⌘ ;` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ Comma` (macOS System Shortcuts), `Ctrl+Alt+Shift+S` (XWin), `Ctrl+Alt+Shift+S` (GNOME), `Ctrl+Alt+Shift+S` (KDE), `Ctrl+Alt+Shift+S` (Emacs), `Ctrl+Alt+Shift+S` (Sublime Text), `⌘ ;` (Sublime Text (macOS)), `Ctrl+Alt+Shift+S` (NetBeans), `Ctrl+Alt+Shift+S` (Visual Studio), `⌘ ;` (Visual Studio (macOS)), `Ctrl+Alt+Shift+S` (Eclipse), `⌘ ;` (Eclipse (macOS))), the dependency will only appear in the IntelliJ IDEA Project tool window, not in the Maven tool window. Note that the next time you synchronize your project, IntelliJ IDEA will remove the added dependency since IntelliJ IDEA considers the Maven configuration as a single source of truth.

Procedure: Sync or Reload all Maven projects

When you initially open your project, IntelliJ IDEA performs the full sync (reload). When you make changes to the project, instead of calling reload for the entire project, you can limit the scope and only sync what is necessary.

* In the [Maven](maven-projects-tool-window.html) tool window, click ![the Sync/Reload All Maven Projects icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.refresh.svg) on the toolbar.

Depending on the synchronization you want to perform, choose one of the following options from the drop-down:

* Sync All Maven Projects: syncs all the projects incrementally. The sync results are displayed in [Build tool window](build-sync-tool-window.html). ![the Build tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/incremental_sync_results.png)

* Reload All Maven Projects: performs the full synchronization of all your Maven projects. The results of the reload are displayed in [Build tool window](build-sync-tool-window.html). ![Reload projects results](https://resources.jetbrains.com.cn/help/img/idea/2026.2/maven_full_sync.png)

Procedure: Configure the auto-sync

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))) , go to `Build, Execution, Deployment | Build Tools`.

Alternatively, In the Maven tool window, click ![Build Tools Settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.settings.svg) and select the Auto-Sync Settings option.

![the Maven tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/maven_tool_window_reload.png)

2. In the Build tools settings, specify the following options:

![the Build Tools settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/build_tools_reload_settings.png)

* Sync project after changes in the build scripts: this option is selected by default. If you want to disable the auto-sync and manually control the synchronization process, unselect this checkbox.

* Any changes: select this option if you want to automatically sync the project after any changes you make to `pom.xml` or external changes. Every time you manually change the Maven build script in the editor, you need to synchronize the changes. IntelliJ IDEA displays a notification icon in the right part of the editor suggesting to Sync Maven Changes made to the project (`Ctrl+Shift+O` (Windows), `Ctrl+Shift+O` (macOS), `Ctrl+Shift+O` (IntelliJ IDEA Classic (macOS)), `Ctrl+Shift+O` (macOS System Shortcuts), `Ctrl+Shift+O` (XWin), `Ctrl+Shift+O` (GNOME), `Ctrl+Shift+O` (KDE), `Ctrl+Shift+O` (Emacs), `Ctrl+Shift+O` (Sublime Text), `Ctrl+Shift+O` (Sublime Text (macOS)), `Ctrl+Shift+O` (NetBeans), `Ctrl+Shift+O` (Visual Studio), `Ctrl+Shift+O` (Visual Studio (macOS)), `Ctrl+Shift+O` (Eclipse), `Ctrl+Shift+O` (Eclipse (macOS))). With the Any changes option, IntelliJ IDEA synchronizes all the changes automatically.

* External changes: when you select this option, IntelliJ IDEA automatically synchronizes the project only after the VCS changes and changes made to the build files outside the IDE.

Procedure: Add a Maven config file to a Maven project

If you want to add files such as `maven.config` or `jvm.config`, you can do so by creating an empty file in the project.

1. In the Project tool window, right-click a directory where you want to create a file.

2. In the context menu, select New | File.

3. In the dialog that opens, enter a name of the file (`maven.config` or `jvm.config`) and click OK.

When you import your project, IntelliJ IDEA reads a content located in the `maven.config` file, but keep in mind that the content of the `jvm.config` is ignored.

For more information about the Maven config files, refer to [https://maven.apache.org/configure.html](https://maven.apache.org/configure.html).

## Link and unlink a Maven project

You can have multiple Maven projects inside one IntelliJ IDEA project. It might be helpful if you keep parts of code in different projects or have some legacy projects on which you need to work. You can link such projects in IntelliJ IDEA and manage them simultaneously. You can also quickly remove such projects from the Maven structure.

Procedure: Link a Maven project

1. Open the [Maven](maven-projects-tool-window.html) tool window.

2. In the Maven tool window, click ![the Link Maven Projects icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) to attach a Maven project.

3. In the dialog that opens, select the desired `pom.xml` file, and click OK.

The project is linked. The Maven tool window shows the toolbar and a tree view of Maven entities.

Procedure: Unlink a Maven project

When you unlink a Maven project, IntelliJ IDEA removes all relevant projects and content roots, removes the Maven project from both the Maven tool window and the Project tool window, and stops its synchronization. It might be helpful if you need to fully remove the previously linked Maven project from the current IntelliJ IDEA project.

1. In the  [Maven](maven-projects-tool-window.html) tool window, right-click a linked project.

2. From the context menu, select Unlink Maven Projects (`Delete` (Windows), `⌦` (macOS), `⌦` (IntelliJ IDEA Classic (macOS)), `⌦` (macOS System Shortcuts), `Delete` (XWin), `Delete` (GNOME), `Delete` (KDE), `Delete` (Emacs), `Delete` (Sublime Text), `⌦` (Sublime Text (macOS)), `Delete` (NetBeans), `Delete` (Visual Studio), `⌦` (Visual Studio (macOS)), `Delete` (Eclipse), `⌦` (Eclipse (macOS)) ). Alternatively, you can select the linked project and click ![the Remove icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.remove.svg) on the tool window's toolbar.

3. Click OK.

## Delegate build and run actions to Maven

By default, IntelliJ IDEA uses the native IntelliJ IDEA builder to build a Maven project. It might be helpful if you have a pure Java or a Kotlin project since IntelliJ IDEA supports the [incremental build](compiling-applications.html#compile_module) which significantly speeds up the building process. However, if you have a configuration that changes the compilation on the fly, or your build generates an artifact with a custom layout, then Maven is preferable for the building process.

Procedure: Build a project with Maven

1. Click ![Maven settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.settings.svg) in the Maven tool window. Alternatively, from the main menu, select `File | Settings | Build, Execution, Deployment |Build Tools | Maven`.

2. Click Maven and from the list, select Runner.

3. On the [Runner](maven-runner.html) page, select Delegate IDE build/run actions to Maven.

![Maven Settings / Runner page](https://resources.jetbrains.com.cn/help/img/idea/2026.2/maven_settings_delegate.png)

4. Click OK.

5. In the main menu, go to `Build | Build Project` `Ctrl+F9` (Windows), `⌘ F9` (macOS), `⌘ F9` (IntelliJ IDEA Classic (macOS)), `⌘ ⌃ B` (macOS System Shortcuts), `Ctrl+F9` (XWin), `Ctrl+F9` (GNOME), `Ctrl+9` (KDE), `Ctrl+F9` (Emacs), `Ctrl+F9` (Sublime Text), `Ctrl+F9` (Sublime Text (macOS)), `F11` (NetBeans), `F7` (Visual Studio), `F7` (Visual Studio (macOS)), `Ctrl+F9` (Eclipse), `⌘ B` (Eclipse (macOS)). IntelliJ IDEA invokes the appropriate Maven goals.

6. Click ![the Build icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.toolwindows.toolWindowBuild.svg) on the status bar to view the results of the sync in the [Build](build-sync-tool-window.html) tool window.

Procedure: Run and debug with Maven

When the [Delegate IDE build/run actions to Мaven](#delegate_run_action) is selected, IntelliJ IDEA runs and debugs your code using Maven. [HotSwap](altering-the-program-s-execution-flow.html) is also gets triggered, and the classes are reloaded during a debugging process.

You can use regular run and debug actions as you use in any other projects.

1. Depending on what action you want to use, from the main menu, select `Run | Run` or `Run | Debug`.

2. Check the results in the Run tool window or in the Debug tool window if you are debugging your code. For example, when you run the main method `Ctrl+Shift+F10` (Windows), `⌃ ⇧ R` (macOS), `⌃ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+F10` (XWin), `Ctrl+Shift+F10` (GNOME), `Ctrl+Shift+F10` (KDE), `Ctrl+Shift+F10` (Emacs), `Ctrl+Shift+F10` (Sublime Text), `Ctrl+Shift+F10` (Sublime Text (macOS)), `Alt+Shift+F6` (NetBeans), `Ctrl+Alt+F5` (Visual Studio), `⌃ ⌥ F5` (Visual Studio (macOS)), `Ctrl+Shift+F10` (Eclipse), `⌃ ⇧ R` (Eclipse (macOS)) in your Java project, IntelliJ IDEA uses Maven to run the class.

![Run tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/main_method_maven_run.png)

