kotlin-multiproject-boilerp.../build.gradle.kts

95 lines
2.4 KiB
Plaintext

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
id("org.springframework.boot") version "2.7.3"
id("io.spring.dependency-management") version "1.0.13.RELEASE"
kotlin("jvm") version "1.6.21"
kotlin("plugin.spring") version "1.6.21" apply false
kotlin("plugin.jpa") version "1.6.21" apply false
}
java.sourceCompatibility = JavaVersion.VERSION_17
allprojects {
group = "com.kakaoent.adp.adserver"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
}
}
subprojects {
apply(plugin = "java")
apply(plugin = "io.spring.dependency-management")
apply(plugin = "org.springframework.boot")
apply(plugin = "org.jetbrains.kotlin.plugin.spring")
apply(plugin = "kotlin")
apply(plugin = "kotlin-spring") //all-open
apply(plugin = "kotlin-jpa")
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")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
runtimeOnly("mysql:mysql-connector-java")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
dependencyManagement {
imports {
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
}
dependencies {
dependency("net.logstash.logback:logstash-logback-encoder:6.6")
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
}
//api <- domain, support 의존
project(":api") {
dependencies {
implementation(project(":domain"))
implementation(project(":support"))
}
}
//domain <- support 의존
project(":domain") {
dependencies {
implementation(project(":support"))
}
}
//support
project(":support") {
val jar: Jar by tasks
val bootJar: BootJar by tasks
bootJar.enabled = false
jar.enabled = true
}