-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
143 lines (124 loc) · 4.35 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import com.epages.restdocs.apispec.gradle.OpenApi3Task
plugins {
id("org.springframework.boot") version "3.1.1"
id("io.spring.dependency-management") version "1.1.0"
id("com.epages.restdocs-api-spec") version "0.17.1"
id("org.sonarqube") version "3.3"
id("jacoco")
kotlin("jvm") version "1.8.22"
kotlin("plugin.spring") version "1.8.22"
}
group = "com.quizit"
version = "0.0.1"
java {
sourceCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
configurations {
all {
exclude("org.springframework.boot", "spring-boot-starter-logging")
}
}
dependencies {
implementation("org.springframework.kafka:spring-kafka")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-aop")
implementation("org.springframework.boot:spring-boot-starter-data-mongodb-reactive")
implementation("org.springframework.boot:spring-boot-starter-log4j2")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
implementation("com.github.earlgrey02:JWT-Module:2.0.2")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("io.projectreactor.kafka:reactor-kafka")
implementation("io.github.microutils:kotlin-logging:3.0.5")
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.restdocs:spring-restdocs-webtestclient")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("io.kotest:kotest-runner-junit5:5.6.2")
testImplementation("io.kotest:kotest-assertions-core:5.6.2")
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.2")
testImplementation("io.mockk:mockk:1.13.5")
testImplementation("io.projectreactor:reactor-test")
testImplementation("com.ninja-squad:springmockk:3.0.1")
testImplementation("com.epages:restdocs-api-spec-webtestclient:0.17.1")
testImplementation("com.epages:restdocs-api-spec:0.17.1")
}
tasks {
compileKotlin {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}
test {
useJUnitPlatform()
finalizedBy(jacocoTestReport, withType<OpenApi3Task>())
}
bootJar {
archiveFileName.set("user-service.jar")
}
jacocoTestCoverageVerification {
violationRules {
rule {
element = "CLASS"
limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = BigDecimal("0.8")
}
limit {
counter = "METHOD"
value = "COVEREDRATIO"
minimum = BigDecimal("0.8")
}
excludes = listOf(
"**.*Application*",
"**.*Configuration*",
"**.*Exception*",
"**.*Util*",
"**.*Aspect*",
"**.*Request*",
"**.*Response*",
"**.*Client*",
"**.*Producer*",
"**.*Consumer*",
"**.*Event*",
"**.*Mdc*"
)
}
}
}
jacocoTestReport {
reports {
html.required.set(true)
xml.required.set(true)
finalizedBy(jacocoTestCoverageVerification)
}
}
}
jacoco {
toolVersion = "0.8.8"
}
sonarqube {
properties {
property("sonar.projectName", "auth")
property("sonar.projectKey", "auth")
property("sonar.host.url", "")
}
}
openapi3 {
setServer("user-service")
title = "User Service API"
version = "v1"
format = "yml"
outputFileNamePrefix = "api"
outputDirectory = "src/main/resources/static/docs"
}