-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
89 lines (75 loc) · 2.68 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
import org.gradle.kotlin.dsl.version
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
val springBootVersion = "2.3.4.RELEASE"
val dependencyManagementVersion = "1.0.11.RELEASE"
project.extra.set("springBootVersion", springBootVersion)
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
classpath("io.spring.gradle:dependency-management-plugin:$dependencyManagementVersion")
}
}
plugins {
val kotlinVersion = "1.4.10"
val springBootVersion = "2.3.4.RELEASE"
val dependencyManagementVersion = "1.0.11.RELEASE"
base
kotlin("jvm") version kotlinVersion apply false
kotlin("plugin.spring") version kotlinVersion apply false
id("org.springframework.boot") version springBootVersion apply false
id("io.spring.dependency-management") version dependencyManagementVersion
}
extra["swaggerVersion"] = "2.9.2"
allprojects {
group = "com.vnapnic"
println("Enabling Spring Boot Dependency Management in project ${project.name}...")
apply(plugin = "io.spring.dependency-management")
repositories {
jcenter()
mavenCentral()
}
}
subprojects {
apply {
plugin("kotlin")
plugin("kotlin-spring")
plugin("org.jetbrains.kotlin.kapt")
plugin("org.springframework.boot")
plugin("org.jetbrains.kotlin.plugin.spring")
}
the<DependencyManagementExtension>().apply {
imports {
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<Jar> {
enabled = true
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
dependencies {
"api"(kotlin("stdlib-jdk8"))
"api"(kotlin("reflect"))
"api"("org.jetbrains.kotlin:kotlin-reflect")
"api"("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
"testImplementation"("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
}
configure<DependencyManagementExtension> {
imports {
val springBootVersion = parent?.extra?.get("springBootVersion")
val springCloudVersion = "Hoxton.SR9"
mavenBom("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion")
mavenBom("org.springframework.boot:spring-boot-parent:$springBootVersion")
}
}
}