From 92ed6485fa4a662d99552f05d6fa469ca18f76ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Ga=C5=82ek?= Date: Tue, 7 Jan 2025 12:25:22 +0100 Subject: [PATCH] apply spring default plugins and boms (#1) * apply spring default plugins and boms * uncomment code * removed spring dependency plugin --- backend/build.gradle.kts | 20 ++++++-------------- build.gradle.kts | 14 ++++++-------- gradle/libs.versions.toml | 25 +++++++++++++------------ settings.gradle.kts | 11 ++++++++++- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index 7f0d9a7..5686c25 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -1,5 +1,6 @@ plugins { java + alias(libs.plugins.spring.boot) alias(libs.plugins.integration.test) alias(libs.plugins.test.logger) } @@ -7,19 +8,10 @@ plugins { group = "io.github.kszapsza" version = "0.0.1-SNAPSHOT" -repositories { - mavenCentral() - maven { url = uri("https://repo.spring.io/milestone") } -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(21) - } -} - dependencies { - implementation(libs.micrometer.registry.prometheus) + implementation(platform(libs.spring.ai.bom)) + implementation(platform(libs.spring.bom)) + runtimeOnly(libs.micrometer.registry.prometheus) implementation(libs.postgresql) implementation(libs.spring.ai.openai.spring.boot.starter) implementation(libs.spring.ai.pgvector.store.spring.boot.starter) @@ -35,6 +27,6 @@ dependencies { integrationImplementation(libs.bundles.testcontainers) } -tasks.withType { +tasks.withType().configureEach { useJUnitPlatform() -} +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index f1bddff..76ab2d0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,17 +6,15 @@ application { mainClass.set("io.github.kszapsza.springairag.SpringAiRagApplication") } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(21) +allprojects { + apply(plugin = "java") + java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } } } -repositories { - mavenCentral() - maven { url = uri("https://repo.spring.io/milestone") } -} - dependencies { implementation(project(":backend")) implementation(project(":frontend")) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d717bb9..7797da7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,23 +1,23 @@ [versions] integration-test = "2.2.2" -junit-platform-launcher = "1.10.0" -micrometer = "1.14.2" spring-ai = "1.0.0-M4" spring-boot = "3.4.1" test-logger = "4.0.0" testcontainers = "1.20.4" [libraries] -junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher", version.ref = "junit-platform-launcher" } -micrometer-registry-prometheus = { group = "io.micrometer", name = "micrometer-registry-prometheus", version.ref = "micrometer" } +junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" } +micrometer-registry-prometheus = { group = "io.micrometer", name = "micrometer-registry-prometheus" } postgresql = { group = "org.postgresql", name = "postgresql" } -spring-ai-openai-spring-boot-starter = { group = "org.springframework.ai", name = "spring-ai-openai-spring-boot-starter", version.ref = "spring-ai" } -spring-ai-pgvector-store-spring-boot-starter = { group = "org.springframework.ai", name = "spring-ai-pgvector-store-spring-boot-starter", version.ref = "spring-ai" } -spring-boot-starter-actuator = { group = "org.springframework.boot", name = "spring-boot-starter-actuator", version.ref = "spring-boot" } -spring-boot-starter-data-jpa = { group = "org.springframework.boot", name = "spring-boot-starter-data-jpa", version.ref = "spring-boot" } -spring-boot-starter-test = { group = "org.springframework.boot", name = "spring-boot-starter-test", version.ref = "spring-boot" } -spring-boot-starter-validation = { group = "org.springframework.boot", name = "spring-boot-starter-validation", version.ref = "spring-boot" } -spring-boot-starter-web = { group = "org.springframework.boot", name = "spring-boot-starter-web", version.ref = "spring-boot" } +spring-ai-bom = { group = "org.springframework.ai", name = "spring-ai-bom", version.ref = "spring-ai" } +spring-bom = { group = "org.springframework.boot", name = "spring-boot-dependencies", version.ref = "spring-boot" } +spring-ai-openai-spring-boot-starter = { group = "org.springframework.ai", name = "spring-ai-openai-spring-boot-starter" } +spring-ai-pgvector-store-spring-boot-starter = { group = "org.springframework.ai", name = "spring-ai-pgvector-store-spring-boot-starter" } +spring-boot-starter-actuator = { group = "org.springframework.boot", name = "spring-boot-starter-actuator" } +spring-boot-starter-data-jpa = { group = "org.springframework.boot", name = "spring-boot-starter-data-jpa" } +spring-boot-starter-test = { group = "org.springframework.boot", name = "spring-boot-starter-test" } +spring-boot-starter-validation = { group = "org.springframework.boot", name = "spring-boot-starter-validation" } +spring-boot-starter-web = { group = "org.springframework.boot", name = "spring-boot-starter-web" } testcontainers = { group = "org.testcontainers", name = "testcontainers", version.ref = "testcontainers" } testcontainers-junit-jupiter = { group = "org.testcontainers", name = "junit-jupiter", version.ref = "testcontainers" } testcontainers-postgresql = { group = "org.testcontainers", name = "postgresql", version.ref = "testcontainers" } @@ -30,5 +30,6 @@ testcontainers = [ ] [plugins] +spring-boot = { id = "org.springframework.boot", version.ref = "spring-boot" } integration-test = { id = "com.coditory.integration-test", version.ref = "integration-test" } -test-logger = { id = "com.adarshr.test-logger", version.ref = "test-logger" } +test-logger = { id = "com.adarshr.test-logger", version.ref = "test-logger" } \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 1345452..c7d6584 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,13 @@ -rootProject.name = "spring-ai-rag" +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" +} + +dependencyResolutionManagement { + repositories { + mavenCentral() + maven { url = uri("https://repo.spring.io/milestone") } + } +} include("backend") include("frontend")