Mastering IntelliJ IDEA Project Structure: A Complete Guide
This article explains IntelliJ IDEA's Project Structure settings—including project name, SDK, language level, compiler output, modules, libraries, facets, and artifacts—detailing how each component works and how they affect building and deploying Java applications.
1. Understanding Project Configuration
IDEA's most important settings are in Project Structure, affecting project execution. The author studied various resources to deepen understanding.
1.1 Project
Project name : defines the project's name.
Project SDK : sets the JDK used by the project; new JDK versions can be added here.
Project language level : specifies the minimum language features required, independent of the JDK version.
Project compiler output : default output directory for compiled classes; modules can override this.
1.2 Modules
Modules represent sub‑projects. Typically a single module is used.
1.2.1 Adding/Removing Sub‑Projects
Each sub‑project corresponds to a module; IntelliJ IDEA defaults to a single‑module project.
1.2.2 Sub‑Project Configuration
Each sub‑project has three main configuration sections:
Sources : shows project directories and their types.
Paths : specifies the compilation output directories for classes and test classes.
Dependencies : lists the project's dependencies.
1.3 Libraries
Displays added JAR files; multiple JARs can be grouped.
1.4 Facets
When you select a framework (a facet) in the element selector pane, the settings for the framework are shown in the right‑hand part of the dialog.
The author notes limited practical impact.
1.5 Artifacts (Web Deployment)
Artifacts define how project assets are assembled for testing, deployment, or distribution (e.g., JAR, WAR, exploded directories).
Key points:
jar : Java Archive containing classes, metadata, and resources.
war : Web Application Archive containing JSP, servlets, classes, XML, static files, etc.
exploded : Uncompressed directory structure of the artifact, useful during development.
When running Tomcat, IDEA performs:
Compilation (IDEA does not compile on save, so it compiles before server start).
Creates directory structure according to the artifact.
Copies web resources to the artifact directory.
Copies compiled classes to WEB-INF/classes.
Copies required JARs to WEB-INF/lib.
Starts the server and optionally opens the browser.
The configured artifact must also be added to Tomcat.
2. Reference Links
https://www.jetbrains.com/help/idea/2016.3/dependencies-tab.html?search=project%20structure https://www.jetbrains.com/help/idea/2016.3/working-with-artifacts.html#artifact_def http://www.cnblogs.com/52php/p/5677661.html http://white-crucifix.iteye.com/blog/2070830 https://my.oschina.net/lujianing/blog/186737
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
