From 4820acc45f4f77c8937da3b57745c2999f275f06 Mon Sep 17 00:00:00 2001 From: h2jinee Date: Sat, 11 Jan 2025 14:00:07 +0900 Subject: [PATCH 1/2] Initial commit --- build.gradle.kts | 71 +++++++++++++++++++ module-app/settings.gradle.kts | 5 ++ .../com/example/movie/MovieApplication.kt | 11 +++ module-common/settings.gradle.kts | 5 ++ module-external/settings.gradle.kts | 5 ++ settings.gradle.kts | 5 ++ 6 files changed, 102 insertions(+) create mode 100644 build.gradle.kts create mode 100644 module-app/settings.gradle.kts create mode 100644 module-app/src/main/kotlin/com/example/movie/MovieApplication.kt create mode 100644 module-common/settings.gradle.kts create mode 100644 module-external/settings.gradle.kts create mode 100644 settings.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..5068447d7 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,71 @@ +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 + java +} + +allprojects { + group = "com.example" + version = "0.0.1-SNAPSHOT" + + repositories { + mavenCentral() + } +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } +} + +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") + apply(plugin = "java") + + java { + sourceCompatibility = JavaVersion.VERSION_21 + } + + tasks.withType { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + jvmTarget = "21" + } + } + + configurations { + compileOnly { + extendsFrom(configurations.annotationProcessor.get()) + } + } + + 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() + } +} + +dependencies { + implementation(kotlin("script-runtime")) +} \ No newline at end of file diff --git a/module-app/settings.gradle.kts b/module-app/settings.gradle.kts new file mode 100644 index 000000000..73cfafad8 --- /dev/null +++ b/module-app/settings.gradle.kts @@ -0,0 +1,5 @@ +rootProject.name = "movie-booking-system" + +include("app-module") +include("common-module") +include("external-module") \ 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/settings.gradle.kts b/module-common/settings.gradle.kts new file mode 100644 index 000000000..73cfafad8 --- /dev/null +++ b/module-common/settings.gradle.kts @@ -0,0 +1,5 @@ +rootProject.name = "movie-booking-system" + +include("app-module") +include("common-module") +include("external-module") \ No newline at end of file diff --git a/module-external/settings.gradle.kts b/module-external/settings.gradle.kts new file mode 100644 index 000000000..73cfafad8 --- /dev/null +++ b/module-external/settings.gradle.kts @@ -0,0 +1,5 @@ +rootProject.name = "movie-booking-system" + +include("app-module") +include("common-module") +include("external-module") \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..73cfafad8 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,5 @@ +rootProject.name = "movie-booking-system" + +include("app-module") +include("common-module") +include("external-module") \ No newline at end of file From 9b5d5a6983d41c7f72980fff0c26d3da5c6844a8 Mon Sep 17 00:00:00 2001 From: h2jinee Date: Sat, 11 Jan 2025 14:42:23 +0900 Subject: [PATCH 2/2] Initial commit --- build.gradle.kts | 40 +++++++---------------------- module-app/build.gradle.kts | 19 ++++++++++++++ module-app/settings.gradle.kts | 5 ---- module-common/build.gradle.kts | 9 +++++++ module-common/settings.gradle.kts | 5 ---- module-external/build.gradle.kts | 4 +++ module-external/settings.gradle.kts | 5 ---- settings.gradle.kts | 6 ++--- 8 files changed, 44 insertions(+), 49 deletions(-) create mode 100644 module-app/build.gradle.kts delete mode 100644 module-app/settings.gradle.kts create mode 100644 module-common/build.gradle.kts delete mode 100644 module-common/settings.gradle.kts create mode 100644 module-external/build.gradle.kts delete mode 100644 module-external/settings.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index 5068447d7..9fb855165 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,6 @@ plugins { 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 - java } allprojects { @@ -18,23 +17,12 @@ allprojects { } } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(21) - } -} - 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") - apply(plugin = "java") - - java { - sourceCompatibility = JavaVersion.VERSION_21 - } tasks.withType { kotlinOptions { @@ -43,29 +31,19 @@ subprojects { } } - configurations { - compileOnly { - extendsFrom(configurations.annotationProcessor.get()) - } - } - 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") + "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() } -} - -dependencies { - implementation(kotlin("script-runtime")) } \ 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/settings.gradle.kts b/module-app/settings.gradle.kts deleted file mode 100644 index 73cfafad8..000000000 --- a/module-app/settings.gradle.kts +++ /dev/null @@ -1,5 +0,0 @@ -rootProject.name = "movie-booking-system" - -include("app-module") -include("common-module") -include("external-module") \ 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-common/settings.gradle.kts b/module-common/settings.gradle.kts deleted file mode 100644 index 73cfafad8..000000000 --- a/module-common/settings.gradle.kts +++ /dev/null @@ -1,5 +0,0 @@ -rootProject.name = "movie-booking-system" - -include("app-module") -include("common-module") -include("external-module") \ 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/module-external/settings.gradle.kts b/module-external/settings.gradle.kts deleted file mode 100644 index 73cfafad8..000000000 --- a/module-external/settings.gradle.kts +++ /dev/null @@ -1,5 +0,0 @@ -rootProject.name = "movie-booking-system" - -include("app-module") -include("common-module") -include("external-module") \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 73cfafad8..731d34850 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,5 @@ rootProject.name = "movie-booking-system" -include("app-module") -include("common-module") -include("external-module") \ No newline at end of file +include("module-app") +include("module-external") +include("module-common")