Project structure в intellij idea как открыть
Перейти к содержимому

Project structure в intellij idea как открыть

  • автор:

Project settings

Project settings apply to the current project only. They are stored in the .xml format together with other project files in the .idea directory. Project settings can include VCS configuration, code style options, the list of language inspections, and other settings.

To configure project settings, select IntelliJ IDEA | Settings on macOS or File | Settings on Windows and Linux from the main menu. Alternatively, you can press Control+Alt+S to show the IDE settings.

In the Settings dialog, project settings that apply only to the current project are marked with the icon. Other settings are global and apply to all existing projects.

the Settings dialog

If you want to share project settings between already existing projects, you can use the Settings Sync plugin. You can also export the settings to a ZIP archive and import it later to other IDE instances.

For the detailed description of every option in the settings, refer to Settings.

If you want to share settings between the already existing projects, you can use the Settings Sync plugin. You can also export the settings into a ZIP archive and import them later to another IDE instance.

Default settings for new projects

You can configure project settings not only for the current project, but for all projects that you will create later. This means that you can set the new default settings for your projects.

Access default settings for new projects

  • In the main menu, go to File | New Projects Setup | Settings for New Projects .

Share project settings through VCS

This information is valid for Git and Mercurial. If you use another version control system, refer to How to manage projects under Version Control Systems for information on how to share projects manually.

Project settings are stored in the project directory as a set of XML files under the .idea folder. This folder contains both user-specific settings that shouldn’t be placed under version control and project settings that are normally shared among developers working in a team, for example, the code style configuration.

When you place a project under version control, your personal settings are automatically ignored. IntelliJ IDEA moves workspace.xml — the file with your personal settings — to the list of ignored files to avoid conflicts with other developers’ settings.

Configuration files are processed according to your choice. Once you modify the project settings, and a new configuration file is created, the IDE shows a notification at the bottom of the screen prompting you to select how you want to treat configuration files in this project:

  • View files : view the list of created configuration files and select, which of them you want to place under version control. After that, the selected files will be scheduled for addition to VCS.
  • Always Add : silently schedule all configuration files created in the .idea directory for addition to VCS (applies only to the current project).
  • Don’t Ask Again : never schedule configuration files for addition to VCS; they will have the unversioned status until you manually add them to VCS (applies only to the current project).

If you close the notification without selecting any option, it will appear again after a new configuration file is created. The new file will also go to the list that will be there until you select one of the options even if you restart the IDE.

Notification prompting to select how to treat configuration files

If the misc.xml or the .ipr file is already under version control, project configuration files are silently scheduled for addition to VCS.

List of non-shareable configuration files

IntelliJ IDEA identifies configuration files and adds them to the list of ignored files automatically. However, if you are sharing your project manually, we recommend that you avoid placing these files and folders under version control:

  • .idea/workspace.xml
  • .idea/usage.statistics.xml
  • .idea/dictionaries folder
  • .idea/shelf folder
  • .idea/libraries if they are generated from Gradle and Maven projects
  • *.iml and .idea/modules.xml files in Maven and Gradle projects
  • gradle.xml
  • *.iws file in file-based projects
  • out folder

Copy global settings to the project level

Global (IDE) settings are stored separately from projects. That is why these settings are not shared through version control together with the project.

Some settings, however, can be copied to the project level. For example, you can create a copy of your code style configuration, inspection profiles, the list of classes and packages excluded from code completion and auto-import. If you do so, the IDE creates the corresponding configuration files in the .idea directory that you can share together with the project through VCS.

IntelliJ IDEA also provides several ways of sharing settings between different IDE instances. For more information, refer to Share IDE settings.

Project structure settings

Project structure settings are stored together with other project files in the .idea directory in the .xml format. These settings include SDKs, project compiler output paths, and libraries that are available for all modules within a project.

To change the project structure settings, click on the toolbar and select Project Structure . Alternatively, go to File | Project Structure or press Control+Alt+Shift+S .

Project page of the Project Structure dialog

Project SDK

An SDK is a collection of tools that you need to develop an application for a specific software framework. If the necessary SDK is installed on your computer, but not defined in the IDE, select Add SDK | ‘SDK name’ , and specify the path to the SDK home directory.

To develop Java-based applications, you need a JDK (Java Development Kit). For more information about setting up the project JDK, refer to Set up the project JDK.

To view or edit the name and contents of the selected SDK, click Edit . For more information about SDK and how to work with them, refer to SDKs.

For Gradle projects, refer to Gradle JVM selection and for Maven projects, refer to Change the JDK version in a Maven project

Project language level

Language level defines coding assistance features that the editor provides. Language level can differ from your project SDK. For example, you can use the JDK 9 and set the language level to 8. This makes the bytecode compatible with Java 8, while inspections make sure you don’t use constructs from Java 9.

Language level also affects compilation. If you don’t manually configure the target bytecode version for your compiler ( Settings | Build, Execution, Deployment | Compiler | Java Compiler ), it will be the same as the project language level.

In some cases, you can select the Preview language level that allows you to use preview features as described in Java Language Specification. For more information about previewing features support, refer to Preview features policy.

Project compiler output

Compiler output path is the path to the directory in which IntelliJ IDEA stores the compilation results. Click the icon to select the output directory. In this directory, the IDE creates two sub-directories:

  • production for production code.
  • test for test sources.

In these subdirectories, individual output directories will be created for each of your modules. The output paths may be redefined at the module level.

Project libraries

Project-level libraries are available for all modules with a project. To configure a project library, in the Project Structure dialog, click Libraries . For more information, refer to Libraries.

Default structure for new projects

You can configure project structure settings not only for the current project, but for all projects that you will be creating later. This means that you can set the new default structure for your projects.

  • In the main menu, go to File | New Projects Setup | Structure .

If you want to share project settings between already existing projects, you can use the Settings Sync plugin. You can also export the settings to a ZIP archive and import it later to other IDE instances.

Preview features policy

IntelliJ IDEA is committed to supporting the preview features from the latest Java release and, if possible, the preview features of whatever release is coming next.

For example, the IntelliJ IDEA v2019.2 supports Java 12 and 13 preview features. Note that v2019.3 drops the support for Java 12 preview features as IntelliJ IDEA 2019.3 is released after the release of Java 13, and so on.

Project structure в intellij idea как открыть

Helen Scott

Configuring the Project Structure

You can configure the structure of your project with ⌘; (macOS) / Ctrl+Alt+Shift+S (Windows/Linux).

The most important thing to note is that if you’re using a build system such as Maven, or Gradle, they will override settings in your Project Structure.

You can change your Java SDK here, and your Language Level. The Java SDK is the collection of tools to develop the application, and your language level defines the coding assistance you get in the editor, and by default, the language level is also your target bytecode version.

You can also manage your existing Java SDKs here and download new ones from various vendors.

Related YouTube Links

Intellij IDEA. Как настроить компиляцию модулей проекта в различные папки?

Использую IDEA (v14 Community Edition). Мне нужно импортировать проекты из Eclipse (несколько штук, подключенных один к другому). Я создал проект (отдельный фолдер на диске) и подключил модули (проекты Eclipse). Теперь при компиляции проекта IDEA все файлы *.class попадают в дефолтовую папку созданного проекта. Её можно изменить, но это, похоже, сработает все равно для всех модулей. Сборщик проекта настроен на источнк для class-файлов в персональных папках каждого модуля. Как настроить компиляцию проекта IDEA, чтобы class-файлы каждого модуля попадали в свои персональные папки?

Отслеживать

68k 221 221 золотой знак 79 79 серебряных знаков 222 222 бронзовых знака

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *