Import a project from Maven
For more information on how to work with Maven, refer to section Maven.
Launch IntelliJ IDEA.
If the Welcome screen opens, click Import Project.
Otherwise, from the main menu, select.
In the dialog that opens, select the pom.xml file of the project you want to import and click Open.
Select Next.and click
Configure the project. For the full list of options, refer to Maven project import options.
If necessary, configure Environment settings:
Maven home directory: select a bundled Maven version that is available (for Maven2, version 2.2.1 and for Maven3, version 3.0.5) or the result of resolved system variables such as
You can also specify your own Maven version that is installed on your machine: click and select the necessary directory.
User settings file: specify the path to the file that contains user-specific configuration for Maven.
Local repository: By default, the field shows the path to the local directory under the user home that stores downloads and contains the temporary build artifacts that you have not yet released.
Override: select this checkbox next to a field where you need to specify a different directory, click the ellipsis button and select the desired path.
On the next step of the wizard, select the Maven projects that you want to import and click Next.
Specify the SDK that you want to use.
If the necessary SDK is already defined in IntelliJ IDEA, select it from the list on the left. Otherwise, click and add a new SDK.
Specify the project name and location and click Finish.
Maven project import options
Specify the directory where the Maven projects you want to import are located.
Search for projects recursively
Select this checkbox to make import look for the nested pom.xml files.
Select the format in which you want to store your project. For the details on the two available formats, refer to the Projects section.
Keep project files in
Select this checkbox to specify the desired location for storing project and module files.
Import Maven projects automatically
Select this checkbox if you want IntelliJ IDEA to perform reimport automatically each time you change your pom.xml.
Create IntelliJ IDEA modules for aggregator projects (with 'pom' packaging)
Clear this checkbox to skip creating IntelliJ IDEA modules. You might want to do that if the Maven project you import is an aggregator, and its
Create module groups for multi-module Maven projects
If this checkbox is selected, IntelliJ IDEA will create a module group from an aggregative Maven project, with the nested modules included in this group.
Keep source and test folders on reimport
If this checkbox is selected, the source and test folders are kept when you reimport a project.
Exclude build directory
Clear this checkbox to disable the automatic exclusion of target folders.
Note if a /target directory contains /target/generated-sources, then the /target directory cannot be excluded since /target/generated -sources directory is marked as sources. Other subdirectories in the /target directory are excluded.
Use Maven output directories
If this checkbox is not selected, the build is created in the regular IntelliJ IDEA's output directory USER_HOME\IdeaProjects\<project>\classes\Production\.
If this checkbox is selected, the build is generated in the Maven's output directory, and the results of IntelliJ IDEA's compilation are reused. However, IntelliJ IDEA itself does not reuse Maven build results and performs compilation from scratch.
Generated sources folders
Specify the directory of your source root when you reimport a project.
You can select one of the following options:
Phase to be used for folders update
Select Maven phase to be used for folders update. This might be useful if you adjust your plugins so that the additional sources are loaded at some phase.
Specify the automatic download of sources and documentation comments into a local repository when you open a Maven project.
You can select one or both of the following checkboxes:
Use this field to specify dependency types that you want to include in your import.