From cbed541b54f6375aca87d3280f96624fe88f28fb Mon Sep 17 00:00:00 2001 From: Hyunseok Ko <56003992+lcomment@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:58:15 +0900 Subject: [PATCH] =?UTF-8?q?Deploy=20|=20CAKK-97=20|=20v2.0.6=20=EB=B0=B0?= =?UTF-8?q?=ED=8F=AC=20(#228)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactor | CAKK-95 | 의존성 관리 방식 관련 리팩토링 * Test | CAKK-95 | Fixture 수정 * Chore | CAKK-95 | 의존성 버전 명세 * Chore | CAKK-95 | dependencyResolutionManagement 활성화 * Refactor | CAKK-95 | 의존성 관리방식을 Gradle Version Catalog로 변경 * Fix | CAKK-100 | 거리 검색 10km로 확장 --- build.gradle.kts | 17 ++- cakk-admin/build.gradle.kts | 18 +-- cakk-api/build.gradle.kts | 54 ++++----- .../shop/SearchShopByLocationRequest.kt | 3 +- .../api/provider/AppleAuthProviderTest.kt | 2 +- .../api/provider/KakaoAuthProviderTest.kt | 2 +- cakk-batch/build.gradle | 30 +++-- cakk-core/build.gradle.kts | 41 ++++--- cakk-domain/mysql/build.gradle.kts | 42 +++---- cakk-domain/redis/build.gradle.kts | 6 +- cakk-external/build.gradle.kts | 12 +- gradle.properties | 14 --- libs.versions.toml | 103 ++++++++++++++++++ settings.gradle.kts | 66 ++++++----- 14 files changed, 253 insertions(+), 157 deletions(-) create mode 100644 libs.versions.toml diff --git a/build.gradle.kts b/build.gradle.kts index f34bb46a..1cba0003 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,13 +2,11 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") - kotlin("plugin.spring") apply false - kotlin("plugin.jpa") apply false - - id("java") - id("org.springframework.boot") apply false - id("io.spring.dependency-management") + alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.kotlin.spring) apply false + alias(libs.plugins.kotlin.jpa) apply false + alias(libs.plugins.spring.boot) apply false + alias(libs.plugins.spring.dependency.management) checkstyle jacoco @@ -52,9 +50,8 @@ subprojects { apply(plugin = "org.jetbrains.kotlin.plugin.jpa") dependencies { - implementation("com.fasterxml.jackson.module:jackson-module-kotlin") - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") - implementation("org.jetbrains.kotlin:kotlin-reflect") + implementation(libs.kotlin.stdlib.jdk8) + implementation(libs.kotlin.reflect) } tasks.withType { diff --git a/cakk-admin/build.gradle.kts b/cakk-admin/build.gradle.kts index 207c9889..0511daba 100644 --- a/cakk-admin/build.gradle.kts +++ b/cakk-admin/build.gradle.kts @@ -9,17 +9,17 @@ tasks.jar { } dependencies { - implementation(project(":cakk-common")) - implementation(project(":cakk-domain:mysql")) - implementation(project(":cakk-core")) + implementation(projects.common) + implementation(projects.persistenceMysql) + implementation(projects.application) - implementation("org.springframework.boot:spring-boot-starter-web") - implementation("org.springframework.boot:spring-boot-starter-validation") - implementation("org.springframework.boot:spring-boot-starter-security") - implementation("org.springframework.boot:spring-boot-starter-oauth2-client") + implementation(libs.spring.boot.starter.web) + implementation(libs.spring.boot.starter.validation) + implementation(libs.spring.boot.starter.security) + implementation(libs.spring.boot.starter.oauth) - implementation("org.springframework:spring-tx") + implementation(libs.spring.tx) // Point - implementation("org.locationtech.jts:jts-core:1.18.2") + implementation(libs.jts.core) } diff --git a/cakk-api/build.gradle.kts b/cakk-api/build.gradle.kts index c78cfa6c..9522dc72 100644 --- a/cakk-api/build.gradle.kts +++ b/cakk-api/build.gradle.kts @@ -1,45 +1,45 @@ description = "api module" dependencies { - implementation(project(":cakk-common")) - implementation(project(":cakk-domain:mysql")) - implementation(project(":cakk-domain:redis")) - implementation(project(":cakk-external")) - implementation(project(":cakk-core")) + implementation(projects.common) + implementation(projects.persistenceMysql) + implementation(projects.persistenceRedis) + implementation(projects.external) + implementation(projects.application) // basic - implementation("org.springframework.boot:spring-boot-starter-web") - implementation("org.springframework.boot:spring-boot-starter-validation") - implementation("org.springframework.boot:spring-boot-starter-aop:3.3.0") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin") - annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") + implementation(libs.spring.boot.starter.web) + implementation(libs.spring.boot.starter.validation) + implementation(libs.spring.boot.starter.aop) + annotationProcessor(libs.spring.boot.configuration.processor) + implementation(libs.kotlin.jackson) // Security & OAuth - implementation("org.springframework.boot:spring-boot-starter-security") - implementation("org.springframework.boot:spring-boot-starter-oauth2-client") - implementation("com.google.api-client:google-api-client-jackson2:2.2.0") - implementation("com.google.api-client:google-api-client:2.2.0") + implementation(libs.spring.boot.starter.security) + implementation(libs.spring.boot.starter.oauth) + implementation(libs.google.api.client) + implementation(libs.google.api.client.jackson2) // Jwt - implementation("io.jsonwebtoken:jjwt-api:0.11.5") - implementation("io.jsonwebtoken:jjwt-impl:0.11.5") - implementation("io.jsonwebtoken:jjwt-jackson:0.11.5") + implementation(libs.jwt.api) + implementation(libs.jwt.impl) + implementation(libs.jwt.jackson) // test - testImplementation("com.tngtech.archunit:archunit-junit5:1.1.0") - testImplementation("org.springframework.boot:spring-boot-starter-test") - testImplementation("org.springframework.security:spring-security-test") - testImplementation("org.mockito.kotlin:mockito-kotlin:5.4.0") - testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter:1.0.23") - testImplementation("io.kotest:kotest-runner-junit5:${property("kotestVersion")}") - testImplementation("io.mockk:mockk:${property("mockKVersion")}") + testImplementation(libs.archunit) + testImplementation(libs.spring.boot.starter.test) + testImplementation(libs.spring.security.test) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.fixture.monkey.starter) + testImplementation(libs.kotest.junit) + testImplementation(libs.mockk) // test container - testImplementation("org.testcontainers:junit-jupiter:1.19.7") - testImplementation("org.testcontainers:mysql:1.19.7") + testImplementation(libs.testcontainers.junit) + testImplementation(libs.testcontainers.mysql) // Point - implementation("org.locationtech.jts:jts-core:1.18.2") + implementation(libs.jts.core) } tasks.bootJar { diff --git a/cakk-api/src/main/kotlin/com/cakk/api/dto/request/shop/SearchShopByLocationRequest.kt b/cakk-api/src/main/kotlin/com/cakk/api/dto/request/shop/SearchShopByLocationRequest.kt index 51c2d365..b0491c20 100644 --- a/cakk-api/src/main/kotlin/com/cakk/api/dto/request/shop/SearchShopByLocationRequest.kt +++ b/cakk-api/src/main/kotlin/com/cakk/api/dto/request/shop/SearchShopByLocationRequest.kt @@ -4,13 +4,12 @@ import jakarta.validation.constraints.Max import jakarta.validation.constraints.Min import jakarta.validation.constraints.NotNull -@JvmRecord data class SearchShopByLocationRequest( @field:NotNull @field:Min(-90) @field:Max(90) val latitude: Double?, @field:NotNull @field:Min(-180) @field:Max(180) val longitude: Double?, - @field:Min(0) @field:Max(3000) + @field:Min(0) @field:Max(10000) val distance: Double? = 1000.0 ) diff --git a/cakk-api/src/test/java/com/cakk/api/provider/AppleAuthProviderTest.kt b/cakk-api/src/test/java/com/cakk/api/provider/AppleAuthProviderTest.kt index f7742de2..a43c5abb 100644 --- a/cakk-api/src/test/java/com/cakk/api/provider/AppleAuthProviderTest.kt +++ b/cakk-api/src/test/java/com/cakk/api/provider/AppleAuthProviderTest.kt @@ -49,7 +49,7 @@ class AppleAuthProviderTest : MockitoTest() { val oidcPublicKeyList = fixtureMonkey.giveMeBuilder(OidcPublicKeyList::class.java) .set("keys", Arbitraries.of(oidcPublicKeyFixture).list().ofMinSize(1).ofMaxSize(10)) .sample() - val publicKey = fixtureMonkey.giveMeOne(PublicKey::class.java) + val publicKey = mock(PublicKey::class.java) val claims = fixtureMonkey.giveMeBuilder(DefaultClaims::class.java).sample() claims.setSubject(Arbitraries.strings().withCharRange('a', 'z').ofMinLength(5).ofMaxLength(10).sample()) diff --git a/cakk-api/src/test/java/com/cakk/api/provider/KakaoAuthProviderTest.kt b/cakk-api/src/test/java/com/cakk/api/provider/KakaoAuthProviderTest.kt index ce02d458..5a860865 100644 --- a/cakk-api/src/test/java/com/cakk/api/provider/KakaoAuthProviderTest.kt +++ b/cakk-api/src/test/java/com/cakk/api/provider/KakaoAuthProviderTest.kt @@ -52,7 +52,7 @@ internal class KakaoAuthProviderTest : MockitoTest() { val oidcPublicKeyList: OidcPublicKeyList = fixtureMonkey.giveMeBuilder(OidcPublicKeyList::class.java) .set("keys", Arbitraries.of(oidcPublicKeyFixture).list().ofMinSize(1).ofMaxSize(10)) .sample() - val publicKey = fixtureMonkey.giveMeOne(PublicKey::class.java) + val publicKey = mock(PublicKey::class.java) val claims = fixtureMonkey.giveMeBuilder(DefaultClaims::class.java).sample() claims.setSubject(getStringFixtureBw(5, 10).sample()) diff --git a/cakk-batch/build.gradle b/cakk-batch/build.gradle index c83c9af4..ed846d9f 100644 --- a/cakk-batch/build.gradle +++ b/cakk-batch/build.gradle @@ -1,35 +1,33 @@ description = "batch module" dependencies { - implementation project(':cakk-common') - implementation project(':cakk-domain:mysql') - implementation project(':cakk-domain:redis') + implementation(projects.common) + implementation(projects.persistenceMysql) + implementation(projects.persistenceRedis) // basic - implementation('org.springframework.boot:spring-boot-starter-web') { - exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' + implementation(libs.spring.boot.starter.web) { + exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat" } - implementation('org.springframework.boot:spring-boot-starter-batch') - implementation('org.springframework.boot:spring-boot-starter-validation') - implementation('org.springframework:spring-tx') - annotationProcessor('org.springframework.boot:spring-boot-configuration-processor') + implementation(libs.spring.boot.starter.batch) + implementation(libs.spring.boot.starter.validation) + annotationProcessor(libs.spring.boot.configuration.processor) // test - testImplementation('com.tngtech.archunit:archunit-junit5:1.1.0') - testImplementation('org.springframework.boot:spring-boot-starter-test') - testImplementation('org.springframework.batch:spring-batch-test') + testImplementation(libs.archunit) + testImplementation(libs.spring.boot.starter.test) // test container - testImplementation('org.testcontainers:junit-jupiter:1.19.7') + testImplementation(libs.testcontainers.junit) // slack 설정 - implementation('net.gpedro.integrations.slack:slack-webhook:1.4.0') + implementation(libs.slack.webhook) // Point - implementation 'org.locationtech.jts:jts-core:1.18.2' + implementation(libs.jts.core) // aws lambda - implementation 'com.amazonaws.serverless:aws-serverless-java-container-springboot3:2.0.1' + implementation(libs.aws.serverless) } tasks.register('buildZip', Zip) { diff --git a/cakk-core/build.gradle.kts b/cakk-core/build.gradle.kts index 89b57b7f..ea319f0a 100644 --- a/cakk-core/build.gradle.kts +++ b/cakk-core/build.gradle.kts @@ -1,39 +1,38 @@ description = "core module" dependencies { - implementation(project(":cakk-common")) - implementation(project(":cakk-domain:mysql")) - implementation(project(":cakk-domain:redis")) - implementation(project(":cakk-external")) + implementation(projects.common) + implementation(projects.persistenceMysql) + implementation(projects.persistenceRedis) + implementation(projects.external) // basic - implementation("org.springframework.boot:spring-boot-starter-web") - implementation("org.springframework.boot:spring-boot-starter-validation") - implementation("org.springframework.boot:spring-boot-starter-aop:3.3.0") - implementation("org.springframework:spring-tx") - annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") + implementation(libs.spring.boot.starter.web) + implementation(libs.spring.boot.starter.validation) + implementation(libs.spring.boot.starter.aop) + annotationProcessor(libs.spring.boot.configuration.processor) // test - testImplementation("com.tngtech.archunit:archunit-junit5:1.1.0") - testImplementation("org.springframework.boot:spring-boot-starter-test") - testImplementation("org.mockito.kotlin:mockito-kotlin:5.4.0") - testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter:1.0.23") - testImplementation("io.kotest:kotest-runner-junit5:${property("kotestVersion")}") - testImplementation("io.mockk:mockk:${property("mockKVersion")}") + testImplementation(libs.archunit) + testImplementation(libs.spring.boot.starter.test) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.fixture.monkey.starter) + testImplementation(libs.kotest.junit) + testImplementation(libs.mockk) // Jwt - implementation("io.jsonwebtoken:jjwt-api:0.11.5") - implementation("io.jsonwebtoken:jjwt-impl:0.11.5") - implementation("io.jsonwebtoken:jjwt-jackson:0.11.5") + implementation(libs.jwt.api) + implementation(libs.jwt.impl) + implementation(libs.jwt.jackson) // Point - implementation("org.locationtech.jts:jts-core:1.18.2") + implementation(libs.jts.core) // Mail - implementation("org.springframework.boot:spring-boot-starter-mail") + implementation(libs.spring.boot.starter.mail) // Slack - implementation("net.gpedro.integrations.slack:slack-webhook:1.4.0") + implementation(libs.slack.webhook) } tasks.bootJar { diff --git a/cakk-domain/mysql/build.gradle.kts b/cakk-domain/mysql/build.gradle.kts index d120ef36..18bec5e2 100644 --- a/cakk-domain/mysql/build.gradle.kts +++ b/cakk-domain/mysql/build.gradle.kts @@ -1,39 +1,39 @@ description = "mysql module" dependencies { - implementation(project(":cakk-common")) + implementation(projects.common) // jpa - api("org.springframework.boot:spring-boot-starter-data-jpa") - implementation("io.hypersistence:hypersistence-utils-hibernate-63:3.7.4") + api(libs.spring.boot.starter.data.jpa) - // test - testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter:1.0.23") - testImplementation("org.assertj:assertj-core") - testImplementation("org.junit.jupiter:junit-jupiter") - testImplementation("org.mockito:mockito-core") - testImplementation("org.mockito:mockito-junit-jupiter") - testImplementation("io.kotest:kotest-runner-junit5:${property("kotestVersion")}") - testRuntimeOnly("org.junit.platform:junit-platform-launcher") + // hibernate + implementation(libs.hibernate.core) + implementation(libs.hibernate.spatial) // querydsl - implementation("com.querydsl:querydsl-jpa:5.0.0:jakarta") - annotationProcessor("com.querydsl:querydsl-apt:5.0.0:jakarta") - annotationProcessor("jakarta.annotation:jakarta.annotation-api") - annotationProcessor("jakarta.persistence:jakarta.persistence-api") - implementation("org.hibernate.orm:hibernate-spatial:6.4.4.Final") + implementation("com.querydsl:querydsl-jpa:5.0.0:jakarta") implementation("com.querydsl:querydsl-spatial") + annotationProcessor("com.querydsl:querydsl-apt:5.0.0:jakarta") + annotationProcessor(libs.jakarta.annotation.api) + annotationProcessor(libs.jakarta.persistence.api) // database - runtimeOnly("com.mysql:mysql-connector-j:8.2.0") - runtimeOnly("com.h2database:h2") + runtimeOnly(libs.mysql.connector.java) //serialize - implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") - implementation("com.fasterxml.jackson.core:jackson-databind") + implementation(libs.jackson.datatype.jsr310) + implementation(libs.jackson.databind) // log - implementation("com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0") + implementation(libs.h6spy) + + // test + testImplementation(libs.assertj.core) + testImplementation(libs.junit.jupiter) + testImplementation(libs.mockito.core) + testImplementation(libs.mockito.junit.jupiter) + testImplementation(libs.kotest.junit) + testImplementation(libs.fixture.monkey.starter) } tasks.bootJar { diff --git a/cakk-domain/redis/build.gradle.kts b/cakk-domain/redis/build.gradle.kts index 7dba6c1c..dea32f84 100644 --- a/cakk-domain/redis/build.gradle.kts +++ b/cakk-domain/redis/build.gradle.kts @@ -1,10 +1,10 @@ description = "redis module" dependencies { - implementation(project(":cakk-common")) + implementation(projects.common) - implementation("org.springframework.boot:spring-boot-starter-data-redis") - implementation("org.redisson:redisson-spring-boot-starter:3.31.0") + implementation(libs.spring.boot.starter.data.redis) + implementation(libs.spring.boot.starter.redisson) } tasks.bootJar { diff --git a/cakk-external/build.gradle.kts b/cakk-external/build.gradle.kts index 1d1fe58d..ff00e5cb 100644 --- a/cakk-external/build.gradle.kts +++ b/cakk-external/build.gradle.kts @@ -1,20 +1,20 @@ description = "external module" dependencies { - implementation(project(":cakk-common")) + implementation(projects.common) // Basic - implementation("org.springframework:spring-context") - implementation("org.springframework:spring-web") + implementation(libs.spring.context) + implementation(libs.spring.web) // AWS - implementation("com.amazonaws:aws-java-sdk-s3:1.12.715") + implementation(libs.aws.java.sdk) // Mail - implementation("org.springframework.boot:spring-boot-starter-mail") + implementation(libs.spring.boot.starter.mail) // Slack - implementation("net.gpedro.integrations.slack:slack-webhook:1.4.0") + implementation(libs.slack.webhook) } diff --git a/gradle.properties b/gradle.properties index 6a254ccc..689d01ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,17 +7,3 @@ projectGroup=com.cakk ### Project Dependency Versions ### kotlinVersion=2.0.10 javaVersion=21 - -### Plugin Dependency Versions ### -ktlintVersion=11.6.1 - -### Spring Dependency Versions ### -springBootVersion=3.2.4 -springDependencyManagementVersion=1.1.4 - -### External Dependency versions ### -querydslVersion=5.0.0 -coroutinesVersion=1.8.0-RC -kotestVersion=5.8.0 -kotestSpringVersion=1.1.3 -mockKVersion=1.13.8 diff --git a/libs.versions.toml b/libs.versions.toml new file mode 100644 index 00000000..7e283084 --- /dev/null +++ b/libs.versions.toml @@ -0,0 +1,103 @@ +[versions] +#java = 21 +kotlin = "2.0.10" +spring = "6.1.5" +spring-boot = "3.2.4" +spring-dependency-management = "1.1.4" +hibernate = "6.4.4.Final" +querydsl = "5.0.0:jakarta" +jwt = "0.11.5" +jackson = "2.18.1" +mockito = "5.14.2" +testcontainers = "1.19.7" + +[plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kotlin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" } +kotlin-jpa = { id = "org.jetbrains.kotlin.plugin.jpa", version.ref = "kotlin" } +kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" } +ktlint = { id = "org.jmailen.kotlinter", version = "3.16.0" } + +spring-boot = { id = "org.springframework.boot", version.ref = "spring-boot" } +spring-dependency-management = { id = "io.spring.dependency-management", version.ref = "spring-dependency-management" } + +[libraries] +# kotlin +kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" } +kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" } + +# jackson +jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" } +jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } +kotlin-jackson = { module = "com.fasterxml.jackson.module:jackson-module-kotlin" } + +# spring +spring-core = { module = "org.springframework:spring-core", version.ref = "spring" } +spring-context = { module = "org.springframework:spring-context", version.ref = "spring" } +spring-web = { module = "org.springframework:spring-web", version.ref = "spring" } +spring-tx = { module = "org.springframework:spring-tx", version.ref = "spring" } + +# basic +spring-boot-starter-web = { module = "org.springframework.boot:spring-boot-starter-web", version.ref = "spring-boot" } +spring-boot-starter-validation = { module = "org.springframework.boot:spring-boot-starter-validation", version.ref = "spring-boot" } +spring-boot-configuration-processor = { module = "org.springframework.boot:spring-boot-configuration-processor", version.ref = "spring-boot" } +spring-boot-starter-aop = { module = "org.springframework.boot:spring-boot-starter-aop", version.ref = "spring-boot" } +spring-boot-starter-batch = { module = "org.springframework.boot:spring-boot-starter-batch", version.ref = "spring-boot" } +spring-boot-starter-mail = { module = "org.springframework.boot:spring-boot-starter-mail", version.ref = "spring-boot" } + +# security +spring-boot-starter-security = { module = "org.springframework.boot:spring-boot-starter-security", version.ref = "spring-boot" } +spring-boot-starter-oauth = { module = "org.springframework.boot:spring-boot-starter-oauth2-client", version.ref = "spring-boot" } +google-api-client = { module = "com.google.api-client:google-api-client", version = "2.2.0" } +google-api-client-jackson2 = { module = "com.google.api-client:google-api-client-jackson2", version = "2.2.0" } +jwt-api = { module = "io.jsonwebtoken:jjwt-api", version.ref = "jwt" } +jwt-impl = { module = "io.jsonwebtoken:jjwt-impl", version.ref = "jwt" } +jwt-jackson = { module = "io.jsonwebtoken:jjwt-jackson", version.ref = "jwt" } + +# db & orm +spring-boot-starter-data-jpa = { module = "org.springframework.boot:spring-boot-starter-data-jpa", version.ref = "spring-boot" } +jts-core = { module = "org.locationtech.jts:jts-core", version = "1.18.2" } +hibernate-core = { module = "org.hibernate:hibernate-core", version.ref = "hibernate" } +hibernate-spatial = { module = "org.hibernate.orm:hibernate-spatial", version.ref = "hibernate" } +jakarta-annotation-api = { module = "jakarta.annotation:jakarta.annotation-api", version = "3.0.0" } +jakarta-persistence-api = { module = "jakarta.persistence:jakarta.persistence-api", version = "3.2.0" } +mysql-connector-java = { module = "com.mysql:mysql-connector-j", version = "8.2.0" } +h2 = { module = "com.h2database:h2", version = "2.3.232" } + +# redis +spring-boot-starter-data-redis = { module = "org.springframework.boot:spring-boot-starter-data-redis", version.ref = "spring-boot" } +spring-boot-starter-redisson = { module = "org.redisson:redisson-spring-boot-starter", version = "3.31.0" } + +# log +slf4j = { module = "org.slf4j:slf4j-api", version = "2.0.9" } +h6spy = { module = "com.github.gavlyukovskiy:p6spy-spring-boot-starter", version = "1.9.0" } + +# aws +aws-java-sdk = { module = "com.amazonaws:aws-java-sdk-s3", version = "1.12.715" } +aws-serverless = { module = "com.amazonaws.serverless:aws-serverless-java-container-springboot3", version = "2.0.1" } + +# slack +slack-webhook = { module = "net.gpedro.integrations.slack:slack-webhook", version = "1.4.0" } + +# test +spring-boot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "spring-boot" } +spring-security-test = { module = "org.springframework.security:spring-security-test", version.ref = "spring" } + +archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "1.1.0" } + +assertj-core = { module = "org.assertj:assertj-core", version = "3.26.3" } +junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version = "5.11.0" } +junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version = "1.11.0" } + +mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" } +mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" } +mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version = "5.4.0" } + +kotest-junit = { module = "io.kotest:kotest-runner-junit5", version = "5.8.0" } + +mockk = { module = "io.mockk:mockk", version = "1.13.8" } + +fixture-monkey-starter = { module = "com.navercorp.fixturemonkey:fixture-monkey-starter", version = "1.1.3" } + +testcontainers-junit = { module = "org.testcontainers:junit-jupiter", version.ref = "testcontainers" } +testcontainers-mysql = { module = "org.testcontainers:mysql", version.ref = "testcontainers" } diff --git a/settings.gradle.kts b/settings.gradle.kts index aa88b6ec..488e9cb3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,32 +1,46 @@ rootProject.name = "cakk" -include( - "cakk-api", - "cakk-admin", - "cakk-batch", - "cakk-core", - "cakk-domain:mysql", - "cakk-domain:redis", - "cakk-external", - "cakk-common" -) - pluginManagement { - val kotlinVersion: String by settings - val springBootVersion: String by settings - val springDependencyManagementVersion: String by settings - val ktlintVersion: String by settings - - resolutionStrategy { - eachPlugin { - when (requested.id.id) { - "org.jetbrains.kotlin.jvm" -> useVersion(kotlinVersion) - "org.jetbrains.kotlin.kapt" -> useVersion(kotlinVersion) - "org.jetbrains.kotlin.plugin.jpa" -> useVersion(kotlinVersion) - "org.jetbrains.kotlin.plugin.spring" -> useVersion(kotlinVersion) - "org.springframework.boot" -> useVersion(springBootVersion) - "io.spring.dependency-management" -> useVersion(springDependencyManagementVersion) - } + repositories { + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.6.0" +} + +// presentation +module(name=":app-api", "cakk-api") +module(name=":admin-api", "cakk-admin") +module(name=":batch", "cakk-batch") + +// external +module(name=":external", "cakk-external") + +// application +module(name=":application", "cakk-core") + +// domain & persistence +module(name=":persistence", "cakk-domain") +module(name=":persistence-mysql", "cakk-domain/mysql") +module(name=":persistence-redis", "cakk-domain/redis") + +// common +module(name=":common", "cakk-common") + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("libs.versions.toml")) } } } + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +fun module(name: String, path: String) { + include(name) + project(name).projectDir = file(path) +}