Skip to content

Commit

Permalink
fix: 멀티모듈 적용시 오류로 인한 gradle 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
van1164 committed Jun 5, 2024
1 parent 2d137ed commit 7d499ab
Show file tree
Hide file tree
Showing 17 changed files with 118 additions and 149 deletions.
140 changes: 44 additions & 96 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,94 +1,53 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.bundling.BootJar

plugins {
id("org.springframework.boot") version "3.2.3"
id("io.spring.dependency-management") version "1.1.4"
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
kotlin("plugin.jpa") version "1.9.22"
}

group = "com.KY"
version = "0.0.1-SNAPSHOT"
val jar: Jar by tasks
val bootJar: BootJar by tasks

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
bootJar.enabled = false
jar.enabled = true

configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
allprojects{
group = "com.van1164"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
}
}

repositories {
mavenCentral()
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-batch")
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-data-redis-reactive")
implementation("org.springframework.boot:spring-boot-starter-oauth2-authorization-server")

implementation("org.springframework.boot:spring-boot-starter-security")

implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("org.apache.kafka:kafka-streams")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("com.amazonaws:aws-java-sdk-s3:1.12.638")
implementation("net.bramp.ffmpeg:ffmpeg:0.8.0")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf:3.2.3")

compileOnly("org.projectlombok:lombok")
runtimeOnly("com.mysql:mysql-connector-j")
annotationProcessor("org.projectlombok:lombok")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.springframework.batch:spring-batch-test")
testImplementation("org.springframework.security:spring-security-test")
implementation("io.github.microutils:kotlin-logging:1.12.0")

//oAuth2
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")

//jwt
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.11.5")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.5")

implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
implementation("com.github.jasync-sql:jasync-r2dbc-mysql:2.2.0")

testImplementation("io.projectreactor:reactor-test:3.6.5")

// kotest
testImplementation("io.kotest:kotest-runner-junit5:5.4.2")
testImplementation("io.kotest:kotest-assertions-core:5.4.2")
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.2")

// mockk
testImplementation("io.mockk:mockk:1.13.8")

}

subprojects {
group = "com.KY"
version = "0.0.1-SNAPSHOT"


apply(plugin = "org.springframework.boot")
apply(plugin = "io.spring.dependency-management")
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")
plugin("io.spring.dependency-management")
plugin("org.jetbrains.kotlin.plugin.spring")
plugin("org.jetbrains.kotlin.jvm")
plugin("kotlin")
plugin("kotlin-kapt")
}
// apply(plugin = "org.springframework.boot")
// apply(plugin = "io.spring.dependency-management")
// apply(plugin = "org.jetbrains.kotlin.plugin.spring")
// apply(plugin = "org.jetbrains.kotlin.plugin.jpa")
// apply(plugin = "kotlin")
// apply(plugin = "kotlin-kapt")


// configurations {
// compileOnly {
// extendsFrom(configurations.annotationProcessor.get())
// }
// }
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
Expand All @@ -97,7 +56,7 @@ subprojects {
compileOnly("org.projectlombok:lombok")
runtimeOnly("com.mysql:mysql-connector-j")
annotationProcessor("org.projectlombok:lombok")
testImplementation("org.springframework.boot:spring-boot-starter-test")

testImplementation("io.projectreactor:reactor-test")
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
implementation("com.github.jasync-sql:jasync-r2dbc-mysql:2.2.0")
Expand All @@ -120,36 +79,25 @@ subprojects {
implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:2.5.0")
implementation("org.springdoc:springdoc-openapi-starter-webflux-api:2.5.0")

//
}

configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")

}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
freeCompilerArgs += "-Xjsr305=strict -Dfile.encoding=UTF-8"
jvmTarget = "17"
}
}

}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
tasks.withType<Test> {
systemProperty("file.encoding","UTF-8")
useJUnitPlatform()
}
}

tasks.withType<Test> {
useJUnitPlatform()
}

12 changes: 4 additions & 8 deletions comment/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import org.springframework.boot.gradle.tasks.bundling.BootJar

plugins {
kotlin("jvm") version "1.9.22"
}

group = "com.van1164"
version = "0.0.1-SNAPSHOT"

repositories {
mavenCentral()
Expand All @@ -15,13 +9,15 @@ val bootJar: BootJar by tasks

bootJar.enabled = false
jar.enabled = true

dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
implementation(project(":util"))
implementation(project(":user"))
implementation(project(":security"))
implementation(project(":main"))
implementation(project(":main_module"))
}

tasks.test {
tasks.withType<Test> {
useJUnitPlatform()
}
7 changes: 7 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Project dependency versions ###
kotlinVersion=1.9.22
javaVersion=21

### Spring dependency versions ###
springBootVersion=3.2.3
springDependencyManagementVersion=1.1.4
13 changes: 5 additions & 8 deletions live_stream/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
kotlin("jvm")
}
import org.springframework.boot.gradle.tasks.bundling.BootJar

group = "com.van1164"
version = "0.0.1-SNAPSHOT"
val jar: Jar by tasks
val bootJar: BootJar by tasks

bootJar.enabled = false
jar.enabled = true
repositories {
mavenCentral()
}
Expand All @@ -15,7 +15,4 @@ dependencies {

tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(20)
}
21 changes: 21 additions & 0 deletions main_module/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import org.springframework.boot.gradle.tasks.bundling.BootJar

val jar: Jar by tasks
val bootJar: BootJar by tasks

bootJar.enabled = false
jar.enabled = true
repositories {
mavenCentral()
}

dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
implementation(project(":util"))
implementation(project(":security"))
implementation(project(":user"))
}

tasks.test {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.van1164.main
package com.van1164.main_module

import com.van1164.common.util.Utils.logger
import com.van1164.security.JwtTokenProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.van1164.main
package com.van1164.main_module

import org.springframework.stereotype.Repository

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.van1164.main
package com.van1164.main_module

import com.van1164.common.response.MainResponse
import com.van1164.common.util.Utils.logger
import com.van1164.main_module.MainService
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.van1164.main
package com.van1164.main_module


import com.van1164.common.response.MainResponse
import com.van1164.main.live.LiveReadService
import com.van1164.main_module.live.LiveReadService
import com.van1164.main.video.VideoReadService
import org.springframework.stereotype.Service
import reactor.core.publisher.Mono
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.van1164.main.live
package com.van1164.main_module.live

import com.van1164.common.domain.LiveStream
import org.springframework.data.r2dbc.repository.R2dbcRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.van1164.main.live
package com.van1164.main_module.live

import com.van1164.common.domain.LiveStream
import com.van1164.main_module.live.LiveReadRepository
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories
import org.springframework.stereotype.Service
import reactor.core.publisher.Flux
Expand Down
1 change: 1 addition & 0 deletions main_module/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.application.name=main_module
5 changes: 1 addition & 4 deletions security/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ dependencies {
implementation(project(":user"))
}

tasks.test {
tasks.withType<Test> {
useJUnitPlatform()
}
kotlin {
jvmToolchain(20)
}
26 changes: 21 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}
rootProject.name = "KoreanYoutube"
include("video")
include("user")
include("security")
include("live_stream")
include("util")
include("main")
include("comment")
include("comment")
include("main_module")

pluginManagement {
val kotlinVersion: String by settings
val springBootVersion: String by settings
val springDependencyManagementVersion: String by settings

resolutionStrategy {
eachPlugin {
when (requested.id.id) {
"org.jetbrains.kotlin.jvm" -> useVersion(kotlinVersion)
"org.jetbrains.kotlin.plugin.spring" -> useVersion(kotlinVersion)
"org.jetbrains.kotlin.plugin.jpa" -> useVersion(kotlinVersion)
"org.jetbrains.kotlin.kapt" -> useVersion(kotlinVersion)
"org.springframework.boot" -> useVersion(springBootVersion)
"io.spring.dependency-management" -> useVersion(springDependencyManagementVersion)
}
}
}
}
6 changes: 1 addition & 5 deletions user/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ dependencies {
implementation(project(":util"))
}

tasks.test {
tasks.withType<Test> {
useJUnitPlatform()
}
kotlin {
jvmToolchain(20)
}
tasks.register("prepareKotlinBuildScriptModel")
6 changes: 0 additions & 6 deletions util/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import org.springframework.boot.gradle.tasks.bundling.BootJar

plugins {
kotlin("jvm")
}

group = "com.van1164"
version = "0.0.1-SNAPSHOT"
Expand All @@ -27,6 +24,3 @@ dependencies {
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(20)
}
Loading

0 comments on commit 7d499ab

Please sign in to comment.