Boost Your Maven Multi‑Module Setup with a One‑Click Generation Plugin
This article introduces a Maven aggregation Quickstart plugin for IntelliJ IDEA that automates the creation of multi‑module Java projects, explains its core features, provides step‑by‑step installation and usage instructions, shows how to customize templates, and offers troubleshooting tips along with the source repository.
Introduction
Manually creating a Maven multi‑module project (folders, pom.xml dependencies, directory layout) is time‑consuming and error‑prone. The Maven Aggregation Quickstart plugin automates the entire scaffolding with a single command, reducing setup time from minutes to seconds.
Why the plugin is needed
Repeated manual steps lead to configuration mistakes (e.g., wrong dependency direction) and waste developer time, especially for newcomers. Automating these steps ensures consistent module structure and correct dependency declarations.
Core features
One‑click generation : Provide module names and the plugin creates the full Maven hierarchy.
Smart dependency linking : Input module order (e.g., api→service→pojo) and the plugin adds appropriate dependency entries.
Customizable parameters : Module names, Java version, and layout can be adjusted to match project standards.
Best‑practice defaults : Uses Maven’s official recommended directory layout.
Zero‑config start : Generates .gitignore and README.md so the project is ready to clone and develop immediately.
Installation
Method 1 – Marketplace (recommended for beginners)
Open IDE Settings ( Ctrl+Alt+S on Windows, Cmd+, on macOS).
Navigate to Plugins → Marketplace.
Search for Maven aggregation Quickstart and click Install.
Restart the IDE.
Method 2 – Manual offline installation
Download the latest JAR from the plugin repository.
Open the plugin settings page, click the gear icon, and choose Install Plugin from Disk....
Select the downloaded JAR file.
IDEA version 2020.3 or newer is required; older versions may be incompatible.
Creating a Maven aggregation project (practical example)
1. Open the New Project wizard and select
Empty Project → File > New > Create Maven Aggregation Project.
2. Fill in the configuration page:
GroupId : e.g., com.wandong ArtifactId : e.g., user-center Version : default 1.0.0 Module names : comma‑separated in business order, e.g., api,service,pojo,common Java version : choose 11 or 17 (newer versions may have compatibility issues).
After clicking Finish, the plugin generates the following structure:
ecommerce-platform/
├── api/
├── service/
├── pojo/
├── common/
├── pom.xml // parent pom
├── README.md
└── .gitignoreEach module follows the standard Maven layout ( src/main/java, src/test/resources, etc.).
Advanced customization (team‑specific templates)
Locate the plugin installation directory (e.g., ~/.local/share/JetBrains/IntelliJIdea/plugins/ on Linux or
C:\Users\<em>Username</em>\AppData\Roaming\JetBrains\<em>PluginName</em>on Windows).
Inside the plugin folder, edit the templates directory’s Velocity template files to match your coding standards.
Restart the IDE; newly generated projects will use the customized templates.
Troubleshooting
Out‑of‑memory errors : Increase IDEA VM options (e.g., -Xmx2048m).
Plugin not found : Ensure IDEA version is 2021.1 or newer, reinstall if necessary, and restart the IDE.
Changing Java version : Edit the parent pom.xml properties maven.compiler.source and maven.compiler.target to the desired version (e.g., 17).
Source code and building
The plugin’s source code is hosted on Gitee and can be cloned for custom extensions.
git clone [email protected]:tingyuabc/maven-aggregation-quickstart.git
cd maven-aggregation-quickstart
mvn clean packageAfter a successful build, install the generated JAR via IDEA’s Install Plugin from Disk... for testing.
Repository
https://gitee.com/tingyuabc/maven-aggregation-quickstart
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
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.
