In IntelliJ IDEA, there is no concept similar to Eclipse workspace (Workspace), but Project
these Module
two concepts are proposed. Next, let's see how IntelliJ IDEA officially describes the two!
For Project, IntelliJ IDEA officially introduced it like this:
A project is a top-level organizational unit for your development work in IntelliJ IDEA. In its finished form, a project may represent a complete software solution. A project is a collection of:
- Your work results: source code, build scripts, configuration files, documentation, artifacts, etc.
- SDKs and libraries that you use to develop, compile, run and test your code.
- Project settings that represent your working preferences in the context of a project.
A project has one or more modules as its parts.
For Module, IntelliJ IDEA officially introduced it like this:
- A module is a part of a project that you can compile, run, test and debug independently.
- Modules are a way to reduce complexity of large projects while maintaining a common (project) configuration.
- Modules are reusable: if necessary, a module can be included in more than one project.
Through the above introduction, we know that it Project
is the top-level structural unit in IntelliJ IDEA, and then Module
, one Project
can have multiple Module
. At present, the mainstream large-scale project structures are basically multi Module
-structures. Such projects are generally divided according to functions, such as: user-core-module, user-facade-module and user-hessian-module, etc. can depend on each other. It can be seen from the naming of these Module
that they are all modules in the same project and have an inseparable business relationship with each other.
Therefore, we can roughly conclude that one Project
is composed of one or more Module
modules, try to keep each module in the same project, and have an interdependent relationship with each other at this time. Here, the reason for saying "try as much as possible" is because IntelliJ IDEA Project
does not have any development functions such as coding settings and builds. It mainly has the effect of a project definition, scope constraint, and specification type. Perhaps, we can also simply Geographical understanding Project
is a simple directory, but this directory must have its representative meaning in naming. In general, IntelliJ IDEA is Project
single Module
. At this time Project
, Module
the two are combined into one. When the storage path is not modified, it obviously Project
has Module
a strong constraint on it! But to be honest, here is the directory where Module
the content is placed , and in fact, it is still self-restraint.Project
Module
- Label 1: Project name, project name;
- Note 2: Project location, project storage address;
- Label 3: Module name, module name;
- Note 4: Module file location, module storage address.
As shown in the figure above, by observing Project
the Module
storage address of and, we can find that a directory named is created here user-core-module
and placed under user-modules-project
the directory named, without combining the two directories into one, It also prepares us to build more Module
.Project
As shown in the figure above, it is obviously user-modules-project
only a directory.
As shown in the figure above, click File
–> New
–> Module
in turn to enter the following interface:
As shown in the figure above, after input Module name
, Content root
and Module file location
automatically change, and then click finish
to complete:
user-modules-project
As shown in the figure above, we have established two in the project Module
, namely user-core-module
and user-hessian-module
. Next, let's look at the storage directory:
As shown in the figure above, obviously in the user-modules-project
directory, there is another directory named user-hessian-module
. At this point, many builds Module
are complete!Project
———— ☆☆☆ ——Back- >The easiest IntelliJ IDEA tutorial in history<- Contents—— ☆☆☆ ————