[#21] modify: 의존성 버전 관리
- dependencies 버전 관리를 위한 관리 클래스 적용 - Version 클래스 따로 구성
This commit is contained in:
@@ -2,11 +2,11 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
plugins {
|
||||
id(Plugins.Spring.BOOT).version(Plugins.Spring.BOOT_VERSION)
|
||||
id(Plugins.Spring.DEPENDENCY_MANAGEMENT).version(Plugins.Spring.DEPENDENCY_MANAGEMENT_VERSION).apply(false)
|
||||
kotlin(Plugins.Kotlin.JVM).version(Plugins.Kotlin.VERSION)
|
||||
kotlin(Plugins.Kotlin.PLUGIN_SPRING).version(Plugins.Kotlin.VERSION).apply(false)
|
||||
kotlin(Plugins.Kotlin.PLUGIN_JPA).version(Plugins.Kotlin.VERSION).apply(false)
|
||||
id(Plugins.Spring.boot).version(Version.Spring.boot)
|
||||
id(Plugins.Spring.dependencyManagement).version(Version.Spring.dependencyManagement).apply(false)
|
||||
kotlin(Plugins.Kotlin.jvm).version(Version.kotlin)
|
||||
kotlin(Plugins.Kotlin.pluginSpring).version(Version.kotlin).apply(false)
|
||||
kotlin(Plugins.Kotlin.pluginJpa).version(Version.kotlin).apply(false)
|
||||
}
|
||||
|
||||
val bootJar: BootJar by tasks
|
||||
@@ -14,7 +14,7 @@ bootJar.enabled = false
|
||||
|
||||
allprojects {
|
||||
group = "io.beaniejoy.dongecafe"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
version = Version.projectVersion
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -23,20 +23,22 @@ allprojects {
|
||||
|
||||
subprojects {
|
||||
apply {
|
||||
plugin(Plugins.JAVA)
|
||||
plugin(Plugins.Spring.DEPENDENCY_MANAGEMENT)
|
||||
plugin(Plugins.Spring.BOOT)
|
||||
plugin(Plugins.java)
|
||||
plugin(Plugins.Spring.dependencyManagement)
|
||||
plugin(Plugins.Spring.boot)
|
||||
|
||||
plugin(Plugins.Kotlin.KOTLIN)
|
||||
plugin(Plugins.Kotlin.KOTLIN_SPRING)
|
||||
plugin(Plugins.Kotlin.KOTLIN_JPA)
|
||||
plugin(Plugins.Kotlin.kotlin)
|
||||
plugin(Plugins.Kotlin.kotlinSpring)
|
||||
plugin(Plugins.Kotlin.kotlinJpa)
|
||||
}
|
||||
|
||||
java.sourceCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
dependencies {
|
||||
// Spring Boot Project
|
||||
implementation("${Plugins.Spring.BOOT}:spring-boot-starter-data-jpa")
|
||||
implementation("${Plugins.Spring.BOOT}:spring-boot-starter-web")
|
||||
implementation("${Plugins.Spring.BOOT}:spring-boot-starter-validation")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
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("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
@@ -48,10 +50,10 @@ subprojects {
|
||||
// DB
|
||||
runtimeOnly("mysql:mysql-connector-java") // MySQL
|
||||
runtimeOnly("com.h2database:h2") // H2
|
||||
implementation("org.flywaydb:flyway-core:7.15.0") // flyway
|
||||
implementation("org.flywaydb:flyway-core:${Version.Deps.flywayCore}") // flyway
|
||||
|
||||
// Logging
|
||||
implementation("io.github.microutils:kotlin-logging:2.1.21")
|
||||
implementation("io.github.microutils:kotlin-logging:${Version.Deps.kotlinLogging}")
|
||||
|
||||
// Test
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
@@ -59,7 +61,7 @@ subprojects {
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
println("Configuring $name in project ${project.name}...")
|
||||
println("### Configuring $name in project ${project.name} ###")
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf("-Xjsr305=strict")
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
@@ -1,23 +1,18 @@
|
||||
object Plugins {
|
||||
const val java = "java"
|
||||
|
||||
object Spring {
|
||||
const val BOOT_VERSION = "2.7.0"
|
||||
const val BOOT = "org.springframework.boot"
|
||||
|
||||
const val DEPENDENCY_MANAGEMENT_VERSION = "1.0.11.RELEASE"
|
||||
const val DEPENDENCY_MANAGEMENT = "io.spring.dependency-management"
|
||||
const val boot = "org.springframework.boot"
|
||||
const val dependencyManagement = "io.spring.dependency-management"
|
||||
}
|
||||
|
||||
const val JAVA = "java"
|
||||
|
||||
object Kotlin {
|
||||
const val KOTLIN = "kotlin"
|
||||
const val KOTLIN_SPRING = "kotlin-spring"
|
||||
const val KOTLIN_JPA = "kotlin-jpa"
|
||||
const val kotlin = "kotlin"
|
||||
const val kotlinSpring = "kotlin-spring"
|
||||
const val kotlinJpa = "kotlin-jpa"
|
||||
|
||||
const val VERSION = "1.6.21"
|
||||
|
||||
const val JVM = "jvm"
|
||||
const val PLUGIN_SPRING = "plugin.spring"
|
||||
const val PLUGIN_JPA = "plugin.jpa"
|
||||
const val jvm = "jvm"
|
||||
const val pluginSpring = "plugin.spring"
|
||||
const val pluginJpa = "plugin.jpa"
|
||||
}
|
||||
}
|
||||
14
buildSrc/src/main/kotlin/Version.kt
Normal file
14
buildSrc/src/main/kotlin/Version.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
object Version {
|
||||
const val projectVersion = "0.0.1-SNAPSHOT"
|
||||
const val kotlin = "1.6.21"
|
||||
|
||||
object Spring {
|
||||
const val boot = "2.7.0"
|
||||
const val dependencyManagement = "1.0.11.RELEASE"
|
||||
}
|
||||
|
||||
object Deps {
|
||||
const val flywayCore = "7.15.0"
|
||||
const val kotlinLogging = "2.1.21"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user