Skip to content

1.2 Maven Multi-Module Build

Sprint: Sprint 01 - Foundation
Feature ID: 1.2
Subtasks: 1.2.1, 1.2.2, 1.2.3

Objective

Deliver "Maven Multi-Module Build" within Sprint 01 - Foundation.

Dependencies

Aggregated from the subtasks below (prerequisite task IDs and enablers):

  • 1.1.1
  • 1.2.1
  • 1.2.2

Subtasks

1.2.1 Create the platform BOM

  • ID: 1.2.1
  • Title: Create platform-bom with pinned dependency versions
  • Description: Create platform/platform-bom (packaging pom) managing versions for Spring Boot, Spring Cloud, PostgreSQL driver, Kafka/Avro, Redis, MapStruct, jjwt, Resilience4j, Springdoc, Micrometer/OpenTelemetry, Testcontainers, RestAssured. All services and platform modules import this BOM; no module hardcodes a version (ADR-003, ADR-020).
  • Business Purpose: One place controls the dependency matrix; eliminates version drift across 13 services.
  • Inputs: ADR-003 (technology stack), ADR-020 (platform Maven architecture), analysis Section 11.
  • Outputs: platform/platform-bom/pom.xml with <dependencyManagement>.
  • Acceptance Criteria:
  • mvn -q -pl platform/platform-bom validate succeeds.
  • Every dependency version referenced elsewhere resolves from the BOM, not inline.
  • Dependencies: 1.1.1
  • Complexity: M

1.2.2 Create the root reactor POM

  • ID: 1.2.2
  • Title: Create root aggregator POM with build plugins
  • Description: Root pom.xml (packaging pom) listing platform and microservices reactors as modules. Configure maven-compiler-plugin (release 21), maven-surefire/failsafe, flatten-maven-plugin for SNAPSHOT resolution if used, and a properties block referencing the BOM.
  • Business Purpose: Single-command build of the whole platform.
  • Inputs: ADR-020.
  • Outputs: Root pom.xml, platform/pom.xml, microservices/pom.xml aggregators.
  • Acceptance Criteria:
  • mvn -q -DskipTests validate from repo root resolves all declared modules.
  • Java release level is 21.
  • Dependencies: 1.2.1
  • Complexity: M

1.2.3 Wire static analysis into the build

  • ID: 1.2.3
  • Title: Configure Checkstyle and SpotBugs gates bound to verify
  • Description: Add Checkstyle (ruleset enforcing no-wildcard-imports, Javadoc on public types) and SpotBugs to the platform reactor POMs, bound to the verify phase. Provide a shared config under build/ consumed by all modules (ADR-014).
  • Business Purpose: Automated enforcement of code quality before merge (NFR-17).
  • Inputs: ADR-014 (CI/CD strategy).
  • Outputs: Checkstyle/SpotBugs config files; plugin bindings in reactor POMs.
  • Acceptance Criteria:
  • mvn -q verify fails on a deliberate Checkstyle violation and passes when clean.
  • Dependencies: 1.2.2
  • Complexity: M

Acceptance Criteria

Each subtask above carries its own objective, testable acceptance criteria. This feature is complete when every subtask's acceptance criteria are met.

Deliverables

  • platform/platform-bom/pom.xml with <dependencyManagement>.
  • Root pom.xml, platform/pom.xml, microservices/pom.xml aggregators.
  • Checkstyle/SpotBugs config files; plugin bindings in reactor POMs.

Definition of Done

  • All subtasks (1.2.1, 1.2.2, 1.2.3) completed and their acceptance criteria verified.
  • All listed dependencies satisfied.
  • Build and tests green per the global conventions in ../README.md (Section 3).