You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

7.5 KiB

Maven-aggregation Quickstart

Maven-aggregation Quickstart is an IntelliJ IDEA plugin designed to quickly generate standard multi-module Maven project structures. With this plugin, you can create modular projects with one click and automatically configure dependencies between modules. It also supports custom module names and Java versions, making it perfect for rapid Java project startup.


๐Ÿ“Œ Key Features

  • One-click creation of Maven multi-module project structure
  • Automatic generation of dependencies between modules
  • Support for custom module names
  • Support for Java version selection (8/11/17/21)
  • Automatic generation of project README.md and .gitignore files
  • Support for both single-module DDD architecture and multi-module architecture
  • Automatic addition of common dependencies (Lombok, Hutool, SLF4J, Logback, Swagger, JUnit, etc.)

๐Ÿš€ Usage

1. Install the Plugin

  1. Open IntelliJ IDEA.
  2. Go to Settings (Preferences) > Plugins.
  3. Click on the Marketplace tab.
  4. Search for Maven-aggregation Quickstart.
  5. Click Install to install the plugin.
  6. Restart IntelliJ IDEA.

2. Create a Project

  1. Create an empty project in IntelliJ IDEA.
  2. Click on the menu File > New > Create Maven Aggregation Project.
  3. Fill in the following information:
    • GroupId: The organization identifier for the Maven project (e.g. com.example)
    • ArtifactId: Project name
    • Version: Project version (default 1.0.0)
    • Select architecture mode: Single-module DDD architecture or multi-module architecture
    • Module names: Enter multiple module names (e.g. api, service, pojo)
    • Java version: Select the Java version used by the project (8/11/17/21)
    • Common dependencies: Select dependencies to add (Lombok, Hutool, SLF4J, etc.)
  4. Click Finish, and the plugin will automatically generate the project structure.

๐Ÿ“ Project Structure Examples

Multi-module Architecture Project Structure

your-project-name/
โ”œโ”€โ”€ api/              # API interface module exposed to the outside world
โ”œโ”€โ”€ service/          # Business logic module
โ”œโ”€โ”€ mapper/           # Data access layer module
โ”œโ”€โ”€ pojo/             # Entity class module
โ”œโ”€โ”€ common/           # Public utility class and common component module
โ””โ”€โ”€ pom.xml           # Parent Maven configuration file

Each module contains the following standard directory structure:
module-name/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main/
โ”‚   โ”‚   โ”œโ”€โ”€ java/           # Java source code
โ”‚   โ”‚   โ””โ”€โ”€ resources/      # Static resource files
โ”‚   โ””โ”€โ”€ test/
โ”‚       โ””โ”€โ”€ java/           # Test code
โ””โ”€โ”€ pom.xml                 # Module-level Maven configuration file

Single-module DDD Architecture Project Structure

your-project-name/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main/
โ”‚   โ”‚   โ”œโ”€โ”€ java/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ com/example/yourproject/
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ application/     # Application layer
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ domain/          # Domain layer
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ infrastructure/  # Infrastructure layer
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ interfaces/      # Interface layer
โ”‚   โ”‚   โ””โ”€โ”€ resources/
โ”‚   โ””โ”€โ”€ test/
โ”‚       โ””โ”€โ”€ java/
โ”œโ”€โ”€ pom.xml
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

๐Ÿงฉ Module Descriptions

Multi-module Architecture Module Descriptions

Module Name Description
api API interface module exposed to the outside world
common Public utility class and common component module
mapper Data access layer module (usually used for database operations)
pojo Entity class module
service Business logic module

Note: You can customize module names, and the plugin will automatically recognize and generate corresponding descriptions.

Single-module DDD Architecture Layer Descriptions

Layer Description
application Application layer, responsible for business process control and use case implementation
domain Domain layer, containing core business logic and domain models
infrastructure Infrastructure layer, providing technical implementation and external dependencies
interfaces Interface layer, responsible for providing external service interfaces

๐Ÿงช Building the Project

The generated Maven project can be built using standard Maven commands:

# Clean the project
mvn clean

# Compile the project
mvn compile

# Run tests
mvn test

# Package the project
mvn package

# Install to local repository
mvn install

๐Ÿ› ๏ธ Plugin Development and Building

If you want to modify or build the plugin from source code, please follow these steps:

1. Clone the Repository

git clone https://github.com/yourname/maven-aggregation.git
cd maven-aggregation

2. Build the Plugin

Use Gradle to build the plugin:

# Clean the project
./gradlew clean

# Build the project
./gradlew build

After building, the plugin .jar file will be generated in the build/libs/ directory.

3. Install the Plugin in IntelliJ IDEA

  1. Open IntelliJ IDEA.
  2. Go to Settings (Preferences) > Plugins.
  3. Click Install Plugin from Disk....
  4. Select build/libs/maven-aggregation-1.1.1.jar.
  5. Install and restart IntelliJ IDEA.

๐Ÿ’– Support the Project

If you find this plugin helpful, please consider supporting the project. Your support will help us continue to improve and maintain this plugin. You can support us through the following ways:

Alipay
(Chinese users)
WeChat Pay
(Chinese users)
PayPal
(International users)
Alipay QR Code WeChat Pay QR Code PayPal
Buy Me a Coffee
(International users)
GitHub Sponsors
(International users)
Open Collective
(International users)
Buy Me a Coffee GitHub Sponsors Open Collective

๐Ÿ“ž Contact Us

If you have any questions or suggestions, please contact:

๐Ÿ“ง Email: 1938023944@qq.com
๐ŸŒ Website: https://www.wandong.com