2019 IDEA multi-module project view each module depend on imported case + Project Structure Details

2019 IDEA multi-module project view each module depend on imported case + Project Structure Details

I. Introduction

After you create a multi-module project uses IDEA tool encounters a problem of the following:

①, using Gradle introduces dependencies in the project, but rely on the use of the module package in time always prompts the missing dependencies.

②, the third project import dependencies hair, add a dependency to prompt classpath, click Add that can be used, where it is in the end add up?

③, IDEA Project Structure in the project structure, which features project management that?

With the above questions, looking for answers below.

Second, view dependencies module case IDEA

1.Project Structure

IDEA Open Project Structure you can see all the project structure. (Project Structure shortcut: Ctrl + Shift + Alt + s)

Solve the first problem : Project Structure --Modules view dependencies

After you create multiple modules under IDEA project, then each will maintain its own module dependencies. When the module is operating absence of prompt dependencies, you can click on it to view the module dependencies situation. See figure below demo2 dependent import module package case.

If there is no need to rely on module dependencies, it can be introduced manually.

Manually add dependency, click the plus sign display three paths may be added dependent

       ①. The first is the option to add downloaded from good local path jar package.

       ②. The second is added from the Libraries directory of the project.

       ③. The third is the module in the current adding other modules, used to call other modules.

 Solve the second problem : IDEA dependencies automatically added to calssPath, added to where?

IDEA prompted to add a dependency CalssPath, in fact, added to the above figure Dependencies corresponding module.

 -----------------------------------------------------------------------------------------------------------------------------------------

Three, Project Structure Description

Project Structure panel to open the shortcut keys: Ctrl + Shift + Alt + s

0.Project Structure Panel Overview

 1.Project panel presentation

  • Project name: project name, project name to edit this field
  • Project SDK: Project SDK, select an item using the java SDK, choose the default project and its own locally installed version of java jdk
  • Project language level: Select the Java language support level. The selected level will be used as the default value item
    • 1.3 - plain old Java
    • 1.4 - "assert" keyword
    •  5.0 - 'enum' keyword, etc. autoboxing
    • 6.0 - @Override interface
    • 7.0 -ARM, multi-capture, etc.
    • 8.0 - Lambda support, type notes, etc.

You can set separate language levels for any of your modules.
Please note that if there is no clear definition of the target level (compiler option -target), believes that it is the same source language level.
Therefore, if -target not clearly defined, it will be synchronized with the language level.

  • Project compiler output: project compiler output, specify the path to the storage IntelliJ IDEA will compile the results. Click to select the path browseButton directory dialog box.

2.Modules panel presentation

Source

  •  Name: Project Name
  • Souces: here on Module development directory folder classification, that is what this module there, describes the content of the different nature of where to put.

These tags represent different aspects of the various elements of a standard Java project, IntelliJ is to identify the contents of a Java project based on these markers, for example, it will be marked as Sources to compile source code using javac, the time will be packaged resources of the labeled copy resource packet to the jar, and the ignore flag of the content Exluded. Left shows the preview of the selected content.

Language level: language level list, use this list to select the Java language level for the module. The available options correspond to the version of the JDK.

Sources: source code files stored in blue.

Tests: Setting the test code stored in the file pieces, green.

Resources: Sources file generally corresponds to the general release profiles, such as: log4j.properties, application.yml.

Test Resources: This corresponds to the Tests folder, the storage of Tests profiles of code.

Excluded: Set file is compiled with the inspection, such as we set out a file folder in the project module.

Paths

 

Paths: Configure compiler output path for the modules, can also specify the location of the external JavaDocs and external annotation associated with the module.

  • Compiler output: compile the output path.
    •  1. Inherit project compile output path: Inheritance project build output path Select this option to use the path specified for the project. That is on top of the file path set out in the Project options.
    •  2. Use module compile output path: compile modules using output path.
    • Output path: the compiler output path.
    •  Test output path: test code compiler output path.
    •  Exclude output paths: the path to exclude output, select this check box to exclude the output directory.
  • JavaDoc: JavaDocs external storage location using a list of available combinations and the associated control module.
  • External Annotations: external annotation. + And - position of the external annotation associated with the management module (directory) list.

Dependencies

Dependencies: On this tab, you can define module SDK and form a module dependency list.

  • Module SDK: module SDK, select the module SDK.

To project SDK associated with the module, choose Project SDK. Please note that if you change the project later SDK, SDK module will change accordingly.
If the desired SDK is not listed, click the "New" and then select the desired type of SDK. Then, in the dialog box that opens, select the SDK home directory, and then click OK.
To view or edit the selected name and contents of the SDK, click Edit. (SDK page will open.)

  • The current list of module dependencies
  • A correlation memory format, the format selected for storing dependency (as Eclipse program modules or IntelliJ IDEA). This option is helpful for teams using different development tools.

3.Libraries panel presentation

  • External Liraries project dependencies in the Libraries list can see the list of dependencies

 

  •  First, you can create a new project library, you can set classification.
  • Jar package can add local and network sources jar package, excluding jar package, remove the jar package.

4.Facets panel presentation

 

  • This module represents what features, such as Web, Spring and Hibernate; 

5.Artifacts panel presentation

Artifact is a concept maven in showing how a module to be packaged, such as war exploded, war, jar, ear, etc. This packaging form;
a module with Artifacts can be deployed to the application server!
When a project has multiple configuration Artifacts good type of option, exploed What does it mean?
Here you can explode understood to unfold, without compression means. That is war, jar and other output was not the directory structure before compression. This mode is recommended when developed, easy to modify the file immediately apparent effect. By default, IDEA Modules and Artifacts of the output directory has been set up, need to change,
labeled as war package will be automatically in the WEB-INF directory production classes directory, and then go into the compiled files. 

6.SDKs

 

  • System development tools, global SDK configuration. 

7.Global libraries

  • Global library, you can configure some commonly used libraries.

8.Problems

Problems, abnormal useful in the project when the project can be repaired (FIXED) follow the prompts.  

Published 316 original articles · won praise 117 · views 420 000 +

Guess you like

Origin blog.csdn.net/m0_38039437/article/details/104757924