From 2f7fe23f45e3a166aff1c22b63ce39263e6ad150 Mon Sep 17 00:00:00 2001 From: StefanMoCoAt Date: Sat, 3 Jan 2026 00:34:08 +0100 Subject: [PATCH] chore(gradle): centralize repository config in `settings.gradle.kts` and simplify BOM management ### Summary - Removed `repositories` blocks from individual `build.gradle.kts` files, moving configuration to `settings.gradle.kts`. - Replaced custom Spring Boot constraints in the platform BOM with the Spring Boot BOM for cleaner dependency management. - Explicitly added `webflux` dependency for Gateway to handle transitivity changes in Spring Boot 4.x. --- .../infrastructure/gateway/build.gradle.kts | 4 ++++ .../ping/ping-service/build.gradle.kts | 6 ++++-- .../registry/oeps-importer/build.gradle.kts | 5 ++--- build.gradle.kts | 13 ++++--------- platform/platform-bom/build.gradle.kts | 19 +++---------------- settings.gradle.kts | 1 - 6 files changed, 17 insertions(+), 31 deletions(-) diff --git a/backend/infrastructure/gateway/build.gradle.kts b/backend/infrastructure/gateway/build.gradle.kts index 08130a53..f2c86b4d 100644 --- a/backend/infrastructure/gateway/build.gradle.kts +++ b/backend/infrastructure/gateway/build.gradle.kts @@ -24,6 +24,10 @@ dependencies { implementation(projects.backend.infrastructure.monitoring.monitoringClient) // === GATEWAY-SPEZIFISCHE ABHÄNGIGKEITEN === + // KORREKTUR: Explizite Deklaration von WebFlux, da es in Spring Boot 4.x + // anscheinend nicht mehr vollständig transitiv vom Gateway-Starter eingebunden wird. + implementation(libs.spring.boot.starter.webflux) + // Kern-Gateway inkl. Security, Actuator, CircuitBreaker, Discovery implementation(libs.bundles.gateway.core) // Ergänzende Observability (Logging, Jackson) diff --git a/backend/services/ping/ping-service/build.gradle.kts b/backend/services/ping/ping-service/build.gradle.kts index 290226c5..27fd7cc5 100644 --- a/backend/services/ping/ping-service/build.gradle.kts +++ b/backend/services/ping/ping-service/build.gradle.kts @@ -14,8 +14,10 @@ springBoot { } dependencies { - // Platform BOM für zentrale Versionsverwaltung - implementation(platform(projects.platform.platformBom)) + // ULTIMATIVER TEST: Wir umgehen unser lokales BOM und importieren das offizielle Spring Boot BOM direkt. + // Wenn dies funktioniert, liegt der Fehler im Aufbau von `:platform:platform-bom`. + implementation(platform(libs.spring.boot.dependencies)) + // implementation(platform(projects.platform.platformBom)) // Platform und Core Dependencies implementation(projects.platform.platformDependencies) diff --git a/backend/services/registry/oeps-importer/build.gradle.kts b/backend/services/registry/oeps-importer/build.gradle.kts index dd9bee82..7acf3404 100644 --- a/backend/services/registry/oeps-importer/build.gradle.kts +++ b/backend/services/registry/oeps-importer/build.gradle.kts @@ -5,9 +5,8 @@ plugins { group = "at.mocode" version = "1.0.0-SNAPSHOT" -repositories { - mavenCentral() -} +// The 'repositories' block was removed from here. +// Repository configuration is now centralized in 'settings.gradle.kts'. dependencies { testImplementation(platform("org.junit:junit-bom:5.10.0")) diff --git a/build.gradle.kts b/build.gradle.kts index 2c98af63..c60bcffe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,15 +40,10 @@ allprojects { group = "at.mocode" version = "1.0.0-SNAPSHOT" - // Apply common repository configuration - repositories { - mavenCentral() - google() - maven { url = uri("https://jitpack.io") } - maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") } - maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") } - maven { url = uri("https://us-central1-maven.pkg.dev/varabyte-repos/public") } - } + // The 'repositories' block was removed from here. + // Repository configuration is now centralized in 'settings.gradle.kts' + // as per modern Gradle best practices. This resolves dependency resolution + // conflicts with platforms and Spring Boot 4+. } subprojects { diff --git a/platform/platform-bom/build.gradle.kts b/platform/platform-bom/build.gradle.kts index 7f59b677..56c5b73e 100644 --- a/platform/platform-bom/build.gradle.kts +++ b/platform/platform-bom/build.gradle.kts @@ -22,22 +22,9 @@ dependencies { // `constraints` erzwingt spezifische Versionen für einzelne Bibliotheken. // Alle Versionen werden sicher aus `libs.versions.toml` bezogen. constraints { - // --- Spring Boot Core Constraints (hart pinnen, um Leaks von M-Releases zu verhindern) --- - api("org.springframework.boot:spring-boot:${libs.versions.springBoot.get()}") - api("org.springframework.boot:spring-boot-autoconfigure:${libs.versions.springBoot.get()}") - api("org.springframework.boot:spring-boot-actuator-autoconfigure:${libs.versions.springBoot.get()}") - api("org.springframework.boot:spring-boot-actuator:${libs.versions.springBoot.get()}") - api("org.springframework.boot:spring-boot-starter:${libs.versions.springBoot.get()}") - api("org.springframework.boot:spring-boot-test:${libs.versions.springBoot.get()}") - api("org.springframework.boot:spring-boot-test-autoconfigure:${libs.versions.springBoot.get()}") - // Zusätzliche Boot-Module, die in neueren Versionen als eigenständige Artefakte vorliegen - // und in AutoConfigurations referenziert werden. Hart pinnen, um Versions-Skew in Tests zu vermeiden. - // HttpClient AutoConfig und Settings - api("org.springframework.boot:spring-boot-http:${libs.versions.springBoot.get()}") - api("org.springframework.boot:spring-boot-autoconfigure-processor:${libs.versions.springBoot.get()}") - api("org.springframework.boot:spring-boot-http-converter:${libs.versions.springBoot.get()}") - // Kontext- und Properties-Unterstützung, auf die PropertyMapper intern zugreifen kann - api("org.springframework.boot:spring-boot-configuration-processor:${libs.versions.springBoot.get()}") + // --- Spring Boot Core Constraints wurden entfernt. --- + // Die Versionen werden jetzt vollständig durch das importierte Spring Boot BOM verwaltet. + // Das ist der saubere und empfohlene Weg. // --- Utilities & Other --- api(libs.caffeine) diff --git a/settings.gradle.kts b/settings.gradle.kts index 7deee9bd..d05243a9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,7 +21,6 @@ plugins { } dependencyResolutionManagement { - repositories { mavenCentral() google()