Modules

Spring DDD ships as focused Gradle modules under the group de.dwittkoetter. Most applications need only one universal starter — spring-ddd-starter-jdbc or spring-ddd-starter-jpa — which bundles all the building-block modules together. Individual modules are listed here for reference; select them directly only when you need fine-grained control over what is activated.

Add a module as a Gradle dependency using:

implementation("de.dwittkoetter:<artifact>:0.0.1-SNAPSHOT")

Core libraries

Module Kind Purpose

spring-ddd-annotations

library

Framework meta-annotations and DDD stereotypes (@EventSourced, @QueryHandler, etc.) aligned with jMolecules.

spring-ddd-messaging

library

Message type annotations (@Message, @Command, @DomainEvent), core type detection, and the persistence-agnostic partition coordination runtime shared by CQRS and event sourcing.

spring-ddd-messaging-jdbc

library

JDBC implementations of the partition coordination substrate: ownership and membership stores, per-dialect SQL, and the coordination schema. All three JDBC starters — CQRS JSON, CQRS JPA, and event sourcing — depend on it, so an application with projections and no event store still runs the substrate.

spring-ddd-converter

library

Scalar type conversion: Jackson serialization and Spring type converters for wrapped value objects.

spring-ddd-domain-events

library

@DomainEventHandler runtime — framework-owned async after-commit event dispatch.

Event Sourcing

Module Kind Purpose

spring-ddd-eventsourcing

library

Event-sourcing core: @EventSourced aggregates, EventStore and SnapshotStore SPIs, aggregate loading and reconstruction.

spring-ddd-eventsourcing-jdbc

library

JDBC implementations of EventStore and SnapshotStore; 6-dialect DDL generation; @EventTable support.

spring-ddd-eventsourcing-test

library

Test DSL for event-sourcing scenarios: given/when/then over aggregates without a running store.

CQRS

Module Kind Purpose

spring-ddd-cqrs

library

Command and query buses, projection engine, and in-memory projection support (@InMemoryProjection).

spring-ddd-cqrs-projection-jdbc

library

Durable JDBC bookkeeping: projection metadata, high-water-mark, and read-model metadata tables.

spring-ddd-cqrs-jdbc

library

@JsonProjection JDBC read-model store with typed @QueryField columns and derived-query support.

spring-ddd-cqrs-jpa

library

JPA @Entity-based projection store.

Saga

Module Kind Purpose

spring-ddd-saga

library

Process-manager / saga core: @Saga, @SagaEventHandler, SagaStore SPI, and deadline SPI.

spring-ddd-saga-jdbc

library

JDBC implementations of SagaStore, deadline store, and inbound checkpoint; @SagaTable support.

Bridges

Module Kind Purpose

spring-ddd-cqrs-bridge

library

Feeds committed events from the event store into the CQRS projection catch-up pipeline.

spring-ddd-saga-bridge

library

Routes domain events from the event store to saga event handlers via the ordered-inbound consumer.

spring-ddd-saga-cqrs-bridge

library

Adapts the CQRS CommandGateway to the saga SagaCommandDispatcher SPI so sagas can emit commands via SagaCommands.

Spring Modulith

Module Kind Purpose

spring-ddd-domain-events-modulith

library

Spring Modulith integration: persists durable event-publication metadata for after-commit handlers.

Universal starters

These two starters are the recommended entry point for most applications. See Choosing your starters for guidance on which to pick.

Module Kind Purpose

spring-ddd-starter-jdbc

starter

Universal JDBC bundle — activates event sourcing, @JsonProjection CQRS, sagas, bridges, and @DomainEventHandler in a single dependency.

spring-ddd-starter-jpa

starter

Universal JPA bundle — activates event sourcing, JPA-entity CQRS projections, sagas, bridges, and @DomainEventHandler in a single dependency.

Framework starters

Module Kind Purpose

spring-ddd-starter-messaging-jdbc

starter

Activates the JDBC partition coordination substrate (spring-ddd-messaging-jdbc) once a DataSource and a transaction manager are present. Depended on by the CQRS JSON, CQRS JPA, and event-sourcing JDBC starters, so every CQRS shape reaches the same coordination gate through exactly one path.

spring-ddd-starter-eventsourcing-jdbc

starter

Activates event-sourcing JDBC infrastructure: event store, snapshot store, and schema initializers.

spring-ddd-starter-cqrs-jdbc

starter

Activates the @JsonProjection store, JDBC projection bookkeeping, and the projection delivery runtime.

spring-ddd-starter-cqrs-jpa

starter

Activates the JPA projection store and delivery runtime.

spring-ddd-starter-cqrs

starter

Bare CQRS bus and in-memory projections — no persistence layer. This is the standalone command/query path for applications that do not use a relational store. It is intentionally omitted from Choosing your starters, which covers persistence-backed paths only.

spring-ddd-starter-saga-jdbc

starter

Activates saga persistence, the deadline poller, and inbound-checkpoint infrastructure.

spring-ddd-starter-domain-events

starter

Activates the @DomainEventHandler dispatch runtime.

spring-ddd-starter-domain-events-modulith-jdbc

starter

Activates the Spring Modulith event-publication metadata JDBC store for durable after-commit handlers.

Bridge starters

Module Kind Purpose

spring-ddd-starter-eventsourcing-cqrs

starter

Activates the CQRS bridge: routes committed events from the event store into the projection catch-up pipeline.

spring-ddd-starter-eventsourcing-saga

starter

Activates the Saga bridge: routes committed events from the event store to saga event handlers.

spring-ddd-starter-saga-cqrs

starter

Auto-configures the saga-to-CQRS command bridge; activates when a CommandGateway bean is present.

Test support

Module Kind Purpose

spring-ddd-starter-eventsourcing-test

test

Test starter that re-exports the event-sourcing test DSL as a single testImplementation dependency.

spring-ddd-jdbc-test

test

Test support for relational stores: the @EnableDatabaseCleanup cleanup extension and the ManagedRelationalSchema footprint SPI.

spring-ddd-starter-jdbc-test

test

Test starter that re-exports spring-ddd-jdbc-test as a single testImplementation dependency.

Actuator starters

Module Kind Purpose

spring-ddd-starter-eventsourcing-actuator

actuator starter

Event-store metrics, health indicator, and per-aggregate management endpoint.

spring-ddd-starter-cqrs-actuator

actuator starter

Projection metrics, health indicator, and projections management endpoint.

spring-ddd-starter-saga-actuator

actuator starter

Saga metrics, health indicator, and sagas management endpoint.

Internal

These modules are internal to the Spring DDD build. Do not declare them as application dependencies.

Module Kind Purpose

spring-ddd-e2e

internal

Internal end-to-end test harness. Not a user dependency.

Choosing a starter

For most applications, the entry point is one of the two universal starters. See Choosing your starters for the authoritative how-to, including a decision guide.

The table below shows exactly which modules each universal starter aggregates, as declared in their build.gradle.kts files.

Included module spring-ddd-starter-jdbc spring-ddd-starter-jpa

spring-ddd-starter-eventsourcing-jdbc

spring-ddd-starter-eventsourcing-cqrs

spring-ddd-starter-eventsourcing-saga

spring-ddd-starter-cqrs-jdbc

spring-ddd-starter-cqrs-jpa

spring-ddd-starter-saga-jdbc

spring-ddd-starter-domain-events

The JPA bundle pulls the durable JDBC bookkeeping layer (spring-ddd-cqrs-projection-jdbc) transitively through spring-ddd-starter-cqrs-jpaspring-ddd-cqrs-jpa, which the @JpaProjection store depends on — it does not need the JSON read-model store (spring-ddd-starter-cqrs-jdbc).