plugins { id 'org.jetbrains.kotlin.jvm' version '2.4.10' apply false id 'org.jetbrains.kotlin.plugin.spring' version '2.4.10' apply false id 'org.jetbrains.kotlin.kapt' version '2.4.10' apply false id 'org.springframework.boot' version '4.1.0' apply false } subprojects { apply plugin: 'java-library' apply plugin: 'org.jetbrains.kotlin.jvm' apply plugin: 'org.jetbrains.kotlin.plugin.spring' group = 'com.continental.retailapp' version = '0.1.0-SNAPSHOT' repositories { mavenCentral() } java { toolchain { languageVersion = JavaLanguageVersion.of(21) } } dependencies { // 版本对齐一律走 Gradle 原生 platform() BOM,不引 io.spring.dependency-management 插件 implementation platform('org.springframework.boot:spring-boot-dependencies:4.1.0') implementation platform('org.springframework.cloud:spring-cloud-dependencies:2025.1.2') testImplementation platform('org.springframework.boot:spring-boot-dependencies:4.1.0') testImplementation platform('org.springframework.cloud:spring-cloud-dependencies:2025.1.2') implementation 'org.jetbrains.kotlin:kotlin-reflect' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'io.mockk:mockk:1.14.2' // Gradle 9 不再自带 JUnit Platform launcher,starter-test 也不带,必须显式声明, // 否则 test 任务直接报 "Could not start Gradle Test Executor"。版本由 junit-bom 管。 testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } kotlin { compilerOptions { freeCompilerArgs.add('-Xjsr305=strict') } } tasks.withType(Test).configureEach { useJUnitPlatform { // 本地快速验证:./gradlew build -PexcludeIntegration // CI 按 09-build-deploy.md 跑完整 ./gradlew test(Runner 需能起 Docker,见 10-testing.md) if (project.hasProperty('excludeIntegration')) { excludeTags 'integration' } } } }