Introduction to Project and Module
These two concepts are one of the must-know points of IntelliJ idea, so be sure to learn.
If you are an eclipse user and have seen the link above, IntelliJ idea first tells you a very important thing: IntelliJ ideas has no concept similar to the Eclipse workspace (workspace). A lot of people who have turned from Eclipse always subconsciously want to manage n projects in the same window again, which is not available in IntelliJ idea. IntelliJ Idea offers the experience of a Project that opens a Windows window.
For Project,intellij idea, this explains:
- Whatever you does in IntelliJ idea, you do this in the context of a project. A project is an organizational unit, represents a complete software solution. It serves as a basis for coding assistance, bulk refactoring, coding style consistency, etc.
- Your finished product may be decomposed to a series of discrete, isolated modules, but it's a project definition that BR Ings them together and ties them into a greater whole.
- Projects don ' t themselves contain development artifacts such as source code, build scripts, or documentation. They is the highest level of organization in the IDE, and they define project-wide settings as well as collections of WHA T IntelliJ idea refers to as modules and libraries.
- Link Address: https://www.jetbrains.com/idea/help/project.html
For Module,intellij idea, this explains:
- A module is a discrete unit of functionality which you can compile, run, test and debug Independe ntly.
- Modules contain everything that's required for their specific tasks:source code, build scripts, unit tests, Deployme NT descriptors, and documentation. However, modules exist and is functional only in the context of a project.
The
- Configuration information for a module was stored in a. IML module file. By default, such a file was located in the module ' s content root folder.
- development teams, normally, share the. IML module files through version control.
- link address: https://www.jetbrains.com/idea/help/module.html
We know from the above that Project is the top level in IntelliJ idea and the sub-level is Module. A Project can have multiple Module. The current mainstream large-scale project structure is similar to this multi-module structure, such projects are generally divided, such as: Core module, Web module, plugin module, SOLR module, and so on, the modules can be interdependent with each other. The naming of these modules also shows that they should be in the same project business situation of the module, each other is an inseparable business relationship.
So we summarize now: One Project is made up of one or more Module components, and the modules are dependent on each other as much as possible in the case of the same project business. Here is 尽量 , because IntelliJ idea Project is a lack of any coding settings, build and other development functions, the main play a project definition, scope constraints, specifications and other types of effects, perhaps we can simply understand as a simple directory, Only this directory naming must have its representative meaning.
Let's take a well-known spring-framework project as an example to introduce the structure of multi-Module:
- Project home: https://github.com/spring-projects/spring-framework:
- The name of the project
Project is: Spring-framework. The main role of the directory for each Module of the top-level directory constraints, tell the co-users, this directory is spring-framework related, I will not put the Android related source code, documents, files on the above. This directory is not a real directory to withdraw, so you can not access the homepage is not visible, but when you checkout , you have to name the project, as for the name of the default is spring-framework .
- There are about 20 of them, and the
Project Module names of each Module have meanings, such as:,,,,, and spring-core spring-jdbc spring-jms spring-orm spring-web spring-webmvc so on, and we can clearly know what they mean by these names, which The Module also has its own src coded directory, which can be coded and built by itself.
- Compared to multi-Module projects, small projects don't have to be so complicated. There is only one module structure IntelliJ idea is supported, and when IntelliJ idea creates a project, the default is the single-module structure.
- As shown in the Gif diagram, at the
Project name time of input, Module name and Module file Location automatically change, Project location and Module file Location exactly the same, this means that the project directory and the Module directory is the same, so at this point in the project directory there will be directory, but we should understand its nature or the directory of Module.
Project and Module on IntelliJ idea have finally been explained, but there is another piece of the IntelliJ idea online that explains it well enough, especially for Eclipse users: https://www.jetbrains.co M/idea/help/eclipse-faq.html, which had such two words:
- An Eclipse workspace are similar to a project in IntelliJ idea
- An Eclipse project maps to a module in IntelliJ idea
You can use IntelliJ idea as Project a workspace IntelliJ, but as much as we explained earlier, this is very inconsistent with its original purpose, so please don't learn this as a doctrine. This is also explained by Daniel Zeroturnaround: http://zeroturnaround.com/rebellabs/ getting-started-with-intellij-idea-as-an-eclipse-user/3/
A new module can be created under a project to create a new project under the project.
Introduction to Project and module