Skip to content

Instantly share code, notes, and snippets.

@ihoneymon
Created March 24, 2019 05:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihoneymon/07fde6b4bced879233907eed246238c1 to your computer and use it in GitHub Desktop.
Save ihoneymon/07fde6b4bced879233907eed246238c1 to your computer and use it in GitHub Desktop.
Gradle kotlin DSL 을 이용한 스프링 부트 애플리케이션 빌드스크립트 예제
buildscript {
extra["kotlinVersion"] = "1.3.11"
extra["springBootVersion"] = "2.1.1.RELEASE"
repositories {
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${extra["kotlinVersion"]}")
classpath("org.jetbrains.kotlin:kotlin-allopen:${extra["kotlinVersion"]}") // kotlin-spring 사용을 위해 필요하다.
/**
* <a href="https://kotlinlang.org/docs/reference/compiler-plugins.html#no-arg-compiler-plugin">No-arg compiler plugin</a>
*/
classpath("org.jetbrains.kotlin:kotlin-noarg:${extra["kotlinVersion"]}") // kotlin-jpa 사용을 위해 필요하다.
classpath("org.springframework.boot:spring-boot-gradle-plugin:${extra["springBootVersion"]}")
}
}
plugins {
id("org.jetbrains.kotlin.jvm") version "1.3.11"
}
apply {
plugin("kotlin")
plugin("kotlin-spring")
plugin("kotlin-jpa")
plugin("idea")
plugin("eclipse")
plugin("org.springframework.boot")
plugin("io.spring.dependency-management")
}
tasks {
compileKotlin {
kotlinOptions {
freeCompilerArgs = mutableListOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = mutableListOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}
}
group = "io.honeymon.sample"
version = "0.0.1-SNAPSHOT"
extra["spek-version"] = "2.0.0-alpha.1"
repositories {
mavenCentral()
maven("https://dl.bintray.com/spekframework/spek-dev")
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-batch")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")
kapt("org.springframework.boot:spring-boot-configuration-processor")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$speckVersion") {
exclude(group = "org.jetbrains.kotlin")
}
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$speckVersion") {
exclude(group = "org.junit.platform")
exclude(group = "org.jetbrains.kotlin")
}
runtimeOnly("com.microsoft.sqlserver:mssql-jdbc")
runtimeOnly("org.mariadb.jdbc:mariadb-java-client")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.batch:spring-batch-test")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment