Best for
- Use when working in a multi-module Maven project.
rrezartprebreza/spring-boot-skills/skills/spring-boot-4/multi-module-maven/SKILL.md
Use when working in a multi-module Maven project. Covers parent POM conventions, shared dependency management, inter-module rules, build ordering, and Spring Boot 4 modular starter selection.
Decision brief
Covers parent POM conventions, shared dependency management, inter-module rules, build ordering, and Spring Boot 4 modular starter selection.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/rrezartprebreza/spring-boot-skills --skill "skills/spring-boot-4/multi-module-maven"Inspect the Agent Skill "multi-module-maven" from https://github.com/rrezartprebreza/spring-boot-skills/blob/8cabf531ead42483fba97b47228ea3b8414cf9b7/skills/spring-boot-4/multi-module-maven/SKILL.md at commit 8cabf531ead42483fba97b47228ea3b8414cf9b7. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Review the “Typical Structure” section in the pinned source before continuing.
Review the “Parent POM” section in the pinned source before continuing.
Review the “Child Module POM (domain — no Spring)” section in the pinned source before continuing.
Review the “Child Module POM (web — the runnable app)” section in the pinned source before continuing.
Review the “Dependency Rules” section in the pinned source before continuing.
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 85/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 194 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
my-app/
├── pom.xml ← Parent POM (packaging = pom)
├── my-app-domain/ ← Pure Java domain — no Spring
│ └── pom.xml
├── my-app-application/ ← Use cases — depends on domain
│ └── pom.xml
├── my-app-infrastructure/ ← JPA, Redis, HTTP clients
│ └── pom.xml
└── my-app-web/ ← Spring Boot app, REST — depends on all above
└── pom.xml
<!-- pom.xml (parent) -->
<project>
<groupId>com.example</groupId>
<artifactId>my-app</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>my-app-domain</module>
<module>my-app-application</module>
<module>my-app-infrastructure</module>
<module>my-app-web</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>4.1.0</version>
</parent>
<!-- Shared versions — all modules inherit -->
<properties>
<java.version>21</java.version>
<mapstruct.version>1.6.0</mapstruct.version>
<testcontainers.version>1.19.8</testcontainers.version>
</properties>
<!-- Dependency management — centralizes versions, NOT adding to classpath -->
<dependencyManagement>
<dependencies>
<!-- Inter-module dependencies -->
<dependency>
<groupId>com.example</groupId>
<artifactId>my-app-domain</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>my-app-application</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Third-party versions -->
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Shared plugins -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
<project>
<parent>
<groupId>com.example</groupId>
<artifactId>my-app</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>my-app-domain</artifactId>
<dependencies>
<!-- No Spring. No JPA. Pure Java only. -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>
<project>
<parent>...</parent>
<artifactId>my-app-web</artifactId>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>my-app-application</artifactId>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>my-app-infrastructure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Only in the runnable module, not parent -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
| Module | Can depend on | Cannot depend on |
|---|---|---|
domain | Nothing | Everything |
application | domain | infrastructure, web |
infrastructure | domain, application | web |
web | All modules | — |
Spring Boot 4 splits the framework into focused modules (spring-boot-<technology>, root
package org.springframework.boot.<technology>). Pick one starter per technology, per module:
spring-boot-starter-web → spring-boot-starter-webmvc,
spring-boot-starter-oauth2-client → spring-boot-starter-security-oauth2-client (and the other
OAuth2 starters gained the security- prefix); spring-boot-starter-data-jpa keeps its namespring-boot-starter-<technology>; test starters follow
spring-boot-starter-<technology>-test (no plain spring-boot-starter-test needed alongside them)spring-boot-starter-flyway /
spring-boot-starter-liquibase in the module that owns migrations (usually infrastructure)spring-boot-starter-aspectj (renamed from spring-boot-starter-aop)spring-boot-starter-tomcat-runtimespring-boot-starter-classic / spring-boot-starter-test-classic bundle the old monolithic
set — transitional only, don't use in new modules<includeOptional>true</includeOptional> on spring-boot-maven-plugin if you rely on themspring-boot-maven-plugin in parent POM — only in the runnable module<dependencies> in parent instead of <dependencyManagement> — adds to all modules' classpathdomain module — domain must be framework-free${project.version} for inter-module versions — correct, but update parent version to update allspring-boot-starter-web — renamed spring-boot-starter-webmvc in Boot 4spring-boot-starter-aop — renamed spring-boot-starter-aspectj in Boot 4flyway-core/liquibase-core expecting Boot to configure them — use spring-boot-starter-flyway / spring-boot-starter-liquibasespring-boot-starter-test next to spring-boot-starter-webmvc-test — the -test starters are self-contained in Boot 4