Boost Your Maven Project Setup: One-Click Multi-Module Generation Plugin
This article introduces a custom IntelliJ IDEA plugin that automates the creation of Maven multi‑module projects, allowing developers to generate full directory structures, pom dependencies, and configuration files with a single command, dramatically reducing setup time from minutes to seconds.
Introduction
When starting a new project, many developers still manually create Maven multi‑module structures, which is time‑consuming. The author built a plugin to generate the whole structure with a single click, reducing setup from dozens of minutes to seconds.
Why the plugin?
Even experienced developers repeat the same tedious steps when creating new projects. The plugin automates folder creation, pom dependencies, and standard Maven layout.
Core Features
One‑click generation : Enter module names and the plugin creates the full directory tree and pom dependencies.
Smart dependency linking : Provide module order (e.g., api→service→pojo) and the plugin automatically adds the correct Maven dependencies.
Full customization : Module names, Java version, and generated structure can be adjusted to match company standards.
Best‑practice templates : Generates Maven‑recommended directory layout.
Zero‑config start : Automatically creates .gitignore and README files.
Installation
Method 1 – Marketplace (recommended for beginners)
Download the JAR manually while the plugin is under review, then install it via IDEA Settings → Plugins → Marketplace after approval.
Method 2 – Manual offline installation
Download the latest JAR from the plugin repository, open IDEA Settings → Plugins, click the gear icon, choose “Install Plugin from Disk…”, and select the JAR.
Quick Start (e‑commerce example)
1. Open the creation wizard
After restarting IDEA, create a new empty project and select Create Maven Aggregation Project from the New Project menu.
2. Fill project information
GroupId: reverse domain, e.g., com.wandong ArtifactId: project name in lower case, e.g., user-center Version: default 1.0.0 Modules: list modules in business order, e.g., api,service,pojo,common Java version: 11 or 17 is recommended
3. Generate
Click Finish; the plugin creates all modules and configuration files in seconds. Example project tree:
ecommerce-platform/
├── api/
├── service/
├── pojo/
├── common/
├── pom.xml // parent pom
├── README.md
└── .gitignoreAdvanced Usage
Custom templates
Modify the plugin’s templates folder (located under the plugin installation directory) to match your team’s code standards, then restart IDEA.
Automatic dependency management
When modules are entered in order (e.g., api,service,pojo), the plugin adds api → service and service → pojo dependencies, and all modules depend on common by default.
Troubleshooting
Out‑of‑memory errors : Increase IDEA VM options, e.g., -Xmx2048m.
Plugin not found : Ensure IDEA version 2021.1 or newer.
Changing Java version : Edit maven.compiler.source and maven.compiler.target in the parent pom.
Source Code and Build
Clone the repository, build with Maven, and install the generated JAR locally.
git clone [email protected]:tingyuabc/maven-aggregation-quickstart.git
cd maven-aggregation
mvn clean packageAfter a successful build, the JAR appears in target/ and can be installed via IDEA’s “Install Plugin from Disk…”.
Conclusion
The plugin eliminates repetitive Maven module setup, saving developers considerable time and ensuring consistent project structure across teams.
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.
Code Ape Tech Column
Former Ant Group P8 engineer, pure technologist, sharing full‑stack Java, job interview and career advice through a column. Site: java-family.cn
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.
