One-Click Maven Multi-Module Setup for Java Projects with IntelliJ Plugin

Discover how to dramatically speed up Java Maven multi‑module project creation by using a custom IntelliJ plugin that generates full module structures, configures dependencies, and applies best‑practice settings in seconds, complete with installation methods, usage tips, and troubleshooting advice.

macrozheng
macrozheng
macrozheng
One-Click Maven Multi-Module Setup for Java Projects with IntelliJ Plugin

Introduction

When starting a new Java project, many developers still manually create Maven multi‑module directories, write pom.xml dependencies, and adjust the structure, which can waste an entire afternoon. This plugin automates those repetitive steps, reducing setup time from minutes to seconds.

Development Background

Both newcomers and experienced engineers often repeat the same mechanical tasks when initializing a project. The author spent two weeks creating a plugin that generates the full project skeleton with a single command, cutting the average setup time from 40 minutes to about 30 seconds.

Core Features

One‑Click Generation : Input module names and the plugin creates the complete directory structure and pom dependencies.

Smart Dependency Linking : Modules are linked according to the order you provide (e.g., api→service→pojo).

Full Customization : Module names, Java version, and other settings can be adjusted to match company standards.

Best‑Practice Templates : Generates Maven‑recommended directory layouts and configuration files.

Zero‑Config Start : Automatically adds .gitignore and README.md so the project is ready to code immediately.

Installation (Two Methods)

Method 1: Marketplace (Recommended for Beginners)

Open IDEA settings ( Ctrl+Alt+S on Windows, Cmd+, on macOS).

Navigate to Plugins and switch to the Marketplace tab.

Search for Maven-aggregation Quickstart and click Install.

Restart IDEA.

Plugin installation screenshot
Plugin installation screenshot

Method 2: Manual Offline Installation

Download the latest .jar from the plugin repository.

Open the plugin settings page in IDEA and click the gear icon.

Select Install Plugin from Disk... and choose the downloaded .jar.

Note: IDEA version must be 2020.3 or newer.

Hands‑On Guide

Step 1: Open the Creation Wizard

After restarting IDEA, choose File > New > Create Maven Aggregation Project (or right‑click a module and select New - Create Maven Aggregation Project).

Step 2: Fill Project Information

GroupId : e.g., com.wandong ArtifactId : project name in lowercase, e.g., user-center Version : default 1.0.0 Module Names : comma‑separated business order, e.g., api,service,pojo,common Java Version : choose 11 or 17.

Project configuration screenshot
Project configuration screenshot
Tip: The order of modules determines the automatic dependency chain.

Step 3: Finish

Click Finish. The plugin generates the full Maven structure in seconds.

ecommerce-platform/
├── api/
├── service/
├── pojo/
├── common/
├── pom.xml       // parent pom
├── README.md
└── .gitignore
Generated project tree
Generated project tree

Advanced Customization

To adapt the plugin to a team’s coding standards, edit the Velocity templates located in the plugin’s templates directory (e.g., ~/.local/share/JetBrains/IntelliJIdea/plugins/…/templates on Linux/macOS or the equivalent path on Windows). After modifying the templates, restart IDEA and new projects will follow the custom layout.

Common Issues & Solutions

Out‑of‑Memory Errors : Increase IDEA’s heap size via Help > Edit Custom VM Options and raise -Xmx (e.g., -Xmx2048m).

Plugin Not Found : Ensure IDEA version is 2021.1 or newer; reinstall if necessary.

Changing Java Version : Edit the parent pom.xml and set maven.compiler.source and maven.compiler.target to the desired version (e.g., 17).

Source Code & Build

Clone the plugin source, build with Maven, and install the generated .jar for testing:

git clone [email protected]:tingyuabc/maven-aggregation-quickstart.git
cd maven-aggregation-quickstart
mvn clean package

After a successful build, locate the .jar in the target/ directory and install it via IDEA’s Install Plugin from Disk... option.

Conclusion

The plugin was created to eliminate repetitive project‑initialization tasks and has become the team’s standard “secret sauce” for bootstrapping Java Maven projects quickly and consistently.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaAutomationpluginmavenproject scaffoldingIntelliJ
macrozheng
Written by

macrozheng

Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.