diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..9fb855165 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,49 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + kotlin("jvm") version "1.9.22" apply false + kotlin("plugin.spring") version "1.9.22" apply false + kotlin("plugin.jpa") version "1.9.22" apply false + id("org.springframework.boot") version "3.2.1" apply false + id("io.spring.dependency-management") version "1.1.4" apply false +} + +allprojects { + group = "com.example" + version = "0.0.1-SNAPSHOT" + + repositories { + mavenCentral() + } +} + +subprojects { + apply(plugin = "org.jetbrains.kotlin.jvm") + apply(plugin = "org.jetbrains.kotlin.plugin.spring") + apply(plugin = "org.jetbrains.kotlin.plugin.jpa") + apply(plugin = "org.springframework.boot") + apply(plugin = "io.spring.dependency-management") + + tasks.withType { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + jvmTarget = "21" + } + } + + dependencies { + "implementation"("org.springframework.boot:spring-boot-starter-data-jpa") + "implementation"("org.springframework.boot:spring-boot-starter-web") + "implementation"("com.fasterxml.jackson.module:jackson-module-kotlin") + "implementation"("org.jetbrains.kotlin:kotlin-reflect") + "runtimeOnly"("com.h2database:h2") + "annotationProcessor"("org.springframework.boot:spring-boot-configuration-processor") + "testImplementation"("org.springframework.boot:spring-boot-starter-test") + "testImplementation"("org.jetbrains.kotlin:kotlin-test-junit5") + "testRuntimeOnly"("org.junit.platform:junit-platform-launcher") + } + + tasks.withType { + useJUnitPlatform() + } +} \ No newline at end of file diff --git a/module-app/build.gradle.kts b/module-app/build.gradle.kts new file mode 100644 index 000000000..27c0296f4 --- /dev/null +++ b/module-app/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("org.springframework.boot") + kotlin("plugin.spring") +} + +springBoot { + mainClass.set("com.example.movie.MovieApplicationKt") +} + +dependencies { + implementation(project(":module-common")) + implementation(project(":module-external")) + + // Web 관련 의존성 + implementation("org.springframework.boot:spring-boot-starter-web") + + // Validation + implementation("org.springframework.boot:spring-boot-starter-validation") +} \ No newline at end of file diff --git a/module-app/src/main/kotlin/com/example/movie/MovieApplication.kt b/module-app/src/main/kotlin/com/example/movie/MovieApplication.kt new file mode 100644 index 000000000..d0021fbda --- /dev/null +++ b/module-app/src/main/kotlin/com/example/movie/MovieApplication.kt @@ -0,0 +1,11 @@ +package com.example.movie + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.runApplication + +@SpringBootApplication +class MovieApplication + +fun main(args: Array) { + runApplication(*args) +} \ No newline at end of file diff --git a/module-common/build.gradle.kts b/module-common/build.gradle.kts new file mode 100644 index 000000000..6e1cc9c6c --- /dev/null +++ b/module-common/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + kotlin("plugin.jpa") +} + +dependencies { + api("org.springframework.boot:spring-boot-starter-data-jpa") + implementation("org.springframework.boot:spring-boot-starter-validation") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin") +} \ No newline at end of file diff --git a/module-external/build.gradle.kts b/module-external/build.gradle.kts new file mode 100644 index 000000000..c9ee2b90c --- /dev/null +++ b/module-external/build.gradle.kts @@ -0,0 +1,4 @@ +dependencies { + implementation(project(":module-common")) // common 모듈 의존 + implementation("org.springframework.boot:spring-boot-starter-webflux") +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..731d34850 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,5 @@ +rootProject.name = "movie-booking-system" + +include("module-app") +include("module-external") +include("module-common")