Project files
An IntelliJ IDEA project can be stored in one of the following formats: file-based, or directory-based.
A file-based format project is defined by the following files: .iws, .ipr and .iml.
- The *.iws file contains workspace with your personal settings, for example, opened files, folding, preferences for VCS, Local History, Run/Debug configurations, etc.
- The *.ipr file stores settings related to a project in general, for example, paths to modules and module libraries, compiler and configurations, entry points, etc.
- The *.iml file describes modules. It includes module paths, dependencies, order settings, etc. A project may contain multiple *.iml files.
In single-module projects, the *.iml file resides in the project root together with the project file. In multi-module projects, each *.iml file resides in the directory of the respective module.
Note
Since *.iws file stores your personal preferences, it should not be placed under version control. On the contrary, the project and module files (*.ipr and *.iml) store project-wide settings, and should be shared.
A directory-based format project is defined by the .idea directory, located in the project root, and *.iml files. *.iml file describe the modules of a project.
The project and workspace settings are stored in a number of .xml files under the .idea directory. Each .xml file is responsible for its own set of settings, that can be recognized by its name: projectCodeStyle.xml, encodings.xml, vcs.xml etc. Thus, for example, adding a new run/debug configuration and changing encoding will affect different xml files. This helps avoid merge conflicts when the project settings are stored in a version control system and modified by different team members.
Note
The files that store local settings (workspace.xml and tasks.xml), should not be placed under version control. All the other settings files should be shared.
Tip
- Any IntelliJ IDEA project created in file-based format can be easily converted into the directory-based format: .
-
When opening a project presented in the Directory Based format
just select the project folder in the Select Path dialog
(it is marked with the
icon).
Project structure
Depending on the logical and functional requirements to the project, you can create a single-module or a multi-module project.
- A single-module project is most suitable for developing simple applications.
-
A multi-module project is used for complex tasks:
- Creating a complicated logical structure.
- Providing separate output for the various parts of the project, for example, deploying multiple JAR files.
- Providing different SDKs for the various parts of the project.
Multi-module projects give you important advantages. Breaking your project into a number of independent modules, you can:
- Reuse and share modules between projects, which can be useful for the collections of utility classes.
- Build and test modules separately.
- Keep each module under its own version control.
Project structure is initially defined on project creation, and can be modified. For example, you can create a single-module project and later add more modules.

