Creating IntelliJ Projects from Maven: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 32: Line 32:
'''Project format''' ".idea (directory based)" should be the default.
'''Project format''' ".idea (directory based)" should be the default.


'''Keep project files in''' From documentation: ''Select this check box to specify the desired location for storing project and module files.'' The default value is the same value as the "Root directory". What this means is that IntelliJ will create an .idea subdirectory in this directory, where it will keep project related files. Note that the IntelliJ module descriptor files (.iml) will NOT be maintained under .idea, but in the "Keep project files in" directory.
'''Keep project files in''' From documentation: ''Select this check box to specify the desired location for storing project and module files.'' The default value is the same value as the "Root directory". What this means is that IntelliJ will create an .idea subdirectory in this directory, where it will keep project related files. Note that the IntelliJ module descriptor files (.iml) will NOT be maintained under .idea, but in the "Keep project files in" directory. Also see [[]]




Line 56: Line 56:


__Generate source folders__
__Generate source folders__


==Project name and Project file location Window==
==Project name and Project file location Window==

Revision as of 19:43, 18 March 2016

External

Internal

Relevance

IntelliJ 14

Overview

This article describes the process of creating an IntelliJ project based on an existing Maven multi-module structure.

Procedure

Import Project -> Select File or Directory to Import

Choose the directory that contains the root pom.xml.

Import project from external model -> Maven

Import Project Main Window

Root directory The project's root directory, the place where the root pom.xml file lives.

Search for projects recursively From IntelliJ documentation: "Select this check box to make import look for the nested pom.xml files".

Project format ".idea (directory based)" should be the default.

Keep project files in From documentation: Select this check box to specify the desired location for storing project and module files. The default value is the same value as the "Root directory". What this means is that IntelliJ will create an .idea subdirectory in this directory, where it will keep project related files. Note that the IntelliJ module descriptor files (.iml) will NOT be maintained under .idea, but in the "Keep project files in" directory. Also see [[]]



Select this check box to specify the desired location for storing project and module files. The alternative is to keep them in the root directory.


__Import Maven projects automatically__ - If checked, IntelliJ will re-import the project automatically every time the pom.xml file(s)(?) is/are changed.

__Create IntelliJ IDEA modules for aggregator projects (with 'pom' packaging)__. Clear this check box to skip creating IntelliJ IDEA modules. You might want to do that if the Maven project you import is an aggregator, and its packaging element has the value pom. By default is enabled. What if I want the behavior for some of them, and I don't for others?

__Create module groups for multi-module Maven projects__ - if checked, a module group will be created from an aggregator Maven project, with nested modules included in the group.


__Keep source and test folders on reimport__ - If this check box is selected, the source and test folders are kept when you reimport a project. What does this mean?


__Exclude build directory (PROJECT_ROOT/target)__ Enables automatic exclusion of target folders. However if /target contains /target/generated-sources, then /target cannot be excluded since /target/generated-sources is marked as sources. Other subdirectories in /target are excluded.

__Use Maven output directories__ If selected, the build is generated in target, and the results of IntelliJ compilation are reused. However, IntelliJ itself does not reuse the Maven build, and performs the compilation from scratch.


__Generate source folders__

Project name and Project file location Window

Project name The name of the IntelliJ project, the way the project will show up

Internally, it is stored in the .idea/.name file.


Project file location From documentation Specify the location of your project directory where IntelliJ IDEA stores the configuration data for your project and its components.