Master IntelliJ IDEA Project Structure: From Projects to Artifacts
This guide explains IntelliJ IDEA’s Project Structure settings—including project name, SDK, language level, modules, sources, paths, dependencies, facets, libraries, and artifacts—detailing how to configure each element, manage sub‑projects, and prepare web deployment packages such as WAR and JAR files.
1. Understanding Project Configuration
In IntelliJ IDEA the most important settings are found under Project Structure , which determines how the project runs. This article consolidates information to help you master these settings.
1.1 Project
Project name: Define the name of the project.
Project SDK: Set the JDK used by the project; you can add other JDK versions here.
Project language level: Specifies the minimum Java language features required, allowing you to compile with a lower level than the JDK version.
Project compiler output: The default directory for compiled output; each module can override this setting.
1.2 Modules
A project can contain multiple sub‑projects, each corresponding to a module. By default IntelliJ IDEA creates a single module.
1.2.1 Adding/Removing Sub‑Projects
Each sub‑project is a module; you can add or remove them as needed.
1.2.2 Sub‑Project Configuration
Each sub‑project has three main configuration sections:
Sources: Shows the project directories that contain source files and resources.
Paths: Allows you to specify the compilation output directories for classes and test classes.
Dependencies: Lists the libraries and other modules that the project depends on.
1.2.3 Adding/Removing Frameworks (Web Deployment‑1)
Under each sub‑project you can define the frameworks it uses; this section focuses on web framework settings.
1.3 Libraries
Shows the JAR files added to the project; you can organize multiple JARs into groups.
1.4 Facets
When you select a framework (facet) in the left pane, its settings appear on the right side of the dialog. This allows you to configure specific framework options.
1.5 Artifacts (Web Deployment‑2)
Artifacts define how the project is packaged for testing, deployment, or distribution. Examples include compiled Java classes, JAR, WAR, or EAR packages.
Typical artifact types:
JAR: Java Archive for bundling classes and resources.
WAR: Web Application Archive containing JSP, servlets, classes, XML, and static web files.
Exploded: Uncompressed directory structure of the artifact, useful during development.
When you run Tomcat, IDEA performs the following steps:
Compiles the project (IDEA does not compile on save like Eclipse).
Creates the directory structure defined in the artifact.
Copies all files from the web resource root into the artifact.
Copies compiled classes into WEB-INF/classes of the artifact.
Copies required JARs into WEB-INF/lib.
Starts the server and optionally opens a browser to the configured URL.
After configuring an artifact, you must add it to the Tomcat server configuration.
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.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
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.
