meldestelle/platform/platform-bom/build.gradle.kts
stefan df5919fac8 feat(build): Refactor infrastructure modules and establish single source of truth
This commit introduces a major refactoring of the build system and the core infrastructure modules. The primary goal is to establish a strict "Single Source of Truth" for all dependencies using Gradle Version Catalogs and to create a clean, maintainable, and scalable foundation for all current and future services.

### 1. Centralized Dependency Management (`libs.versions.toml`)

- **Established Single Source of Truth:** All dependency versions are now exclusively managed in `gradle/libs.versions.toml`. Hardcoded versions have been removed from all build scripts.
- **Introduced Gradle Bundles:** To simplify module dependencies, several bundles have been created (e.g., `testing-jvm`, `redis-cache`, `spring-cloud-gateway`, `monitoring-client`). This drastically reduces boilerplate in the `build.gradle.kts` files and improves readability.
- **Cleaned up Aliases:** All library and plugin aliases have been standardized for consistency.

### 2. Infrastructure Module Refactoring

All infrastructure modules (`core`, `platform`, `auth`, `cache`, `event-store`, `messaging`, `monitoring`, `gateway`) have been refactored to align with the new dependency management strategy.

- **Simplified Build Scripts:** The `build.gradle.kts` for each module now uses the new bundles and aliases, making them significantly cleaner and easier to understand.
- **Consistent Structure:** The architecture of each module now clearly follows the Port-Adapter pattern where applicable (e.g., `cache-api`/`redis-cache`).
- **Standardized `platform-bom`:** The project's own Bill of Materials (`platform-bom`) now also includes the Spring Cloud BOM, ensuring version consistency for all Spring-related dependencies.

### 3. Added Infrastructure Documentation

To improve onboarding and architectural understanding, a dedicated `README-*.md` file has been created for each refactored infrastructure module:
- `README-CORE.md`
- `README-PLATFORM.md`
- `README-INFRA-AUTH.md`
- `README-INFRA-CACHE.md`
- `README-INFRA-EVENT-STORE.md`
- `README-INFRA-MESSAGING.md`
- `README-INFRA-MONITORING.md`
- `README-INFRA-GATEWAY.md`

These documents explain the purpose, architecture, and usage of each component within the system. This lays the groundwork for our "Tracer Bullet" development approach.
2025-07-31 14:09:22 +02:00

71 lines
2.3 KiB
Plaintext

// Dieses Modul definiert die "Bill of Materials" (BOM) für das gesamte Projekt.
// Es nutzt das `java-platform`-Plugin, um eine zentrale Liste von Abhängigkeitsversionen
// zu erstellen, die von allen anderen Modulen importiert wird.
// Dies ist die ultimative "Single Source of Truth" für Versionen.
plugins {
`java-platform`
`maven-publish` // Nützlich, falls die BOM extern veröffentlicht werden soll
}
javaPlatform {
// Erlaubt die Deklaration von Abhängigkeiten in einer Plattform.
allowDependencies()
}
dependencies {
// Importiert andere wichtige BOMs. Die Versionen werden durch diese
// importierten Plattformen transitiv verwaltet.
api(platform(libs.spring.boot.dependencies))
api(platform(libs.spring.cloud.dependencies)) // NEU: Spring Cloud BOM hinzugefügt
api(platform(libs.kotlin.bom))
api(platform(libs.kotlinx.coroutines.bom))
// `constraints` erzwingt spezifische Versionen für einzelne Bibliotheken.
// Alle Versionen werden sicher aus `libs.versions.toml` bezogen.
constraints {
// --- Utilities & Other ---
api(libs.caffeine)
api(libs.reactor.kafka)
api(libs.redisson)
api(libs.uuid)
api(libs.bignum)
api(libs.consul.client)
api(libs.kotlin.logging.jvm)
api(libs.jakarta.annotation.api)
api(libs.auth0.java.jwt)
api(libs.logback.classic)
// --- Spring & SpringDoc ---
api(libs.springdoc.openapi.starter.common)
api(libs.springdoc.openapi.starter.webmvc.ui)
// --- Database & Persistence ---
api(libs.bundles.exposed)
api(libs.bundles.flyway)
api(libs.postgresql.driver)
api(libs.hikari.cp)
api(libs.h2.driver)
api(libs.lettuce.core)
// --- Kotlinx Libraries ---
api(libs.kotlinx.serialization.json)
api(libs.kotlinx.datetime)
// --- Jackson Modules ---
api(libs.jackson.module.kotlin)
api(libs.jackson.datatype.jsr310)
// --- Testcontainers ---
api(libs.bundles.testcontainers)
}
}
// Konfiguration für das Veröffentlichen der BOM (optional, aber gute Praxis).
publishing {
publications {
create<MavenPublication>("maven") {
from(components["javaPlatform"])
}
}
}