forked from ClothingStoreService/clothstar_v3.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
160 lines (132 loc) · 5.51 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
plugins {
id("org.springframework.boot") version "3.3.2"
id("io.spring.dependency-management") version "1.1.6"
id("org.jetbrains.kotlin.kapt") version "1.9.24"
kotlin("jvm") version "1.9.24"
kotlin("plugin.spring") version "1.9.24"
kotlin("plugin.jpa") version "1.9.24" //Entity의 기본생성자를 자동으로 만들어줌
java
jacoco
}
group = "org.store"
version = "0.0.1-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
maven(url = "https://jitpack.io")
}
dependencies {
//basic
implementation("org.springframework.boot:spring-boot-starter")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.springframework.boot:spring-boot-starter-validation")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
implementation("io.github.oshai:kotlin-logging-jvm:5.1.4")
//web
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-webflux")
//thymeleaf
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
// logging
implementation("io.github.oshai:kotlin-logging-jvm:5.1.4")
//security
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.thymeleaf.extras:thymeleaf-extras-springsecurity6")
implementation("io.jsonwebtoken:jjwt-api:0.12.3")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.12.3")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.12.3")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.security:spring-security-test")
//DB
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("p6spy:p6spy:3.9.1")
implementation("com.github.gavlyukovskiy:datasource-decorator-spring-boot-autoconfigure:1.9.0")
runtimeOnly("com.mysql:mysql-connector-j")
runtimeOnly("com.h2database:h2")
//Querydsl
implementation("com.querydsl:querydsl-jpa:5.0.0:jakarta")
kapt("com.querydsl:querydsl-apt:5.0.0:jakarta")
kapt("org.springframework.boot:spring-boot-configuration-processor")
//test
val mockkVersion = "1.13.12"
val kotestVersion = "5.8.0"
testImplementation("io.mockk:mockk:${mockkVersion}")
testImplementation("io.kotest:kotest-runner-junit5:${kotestVersion}")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("com.squareup.okhttp3:okhttp:4.9.1")
testImplementation("com.squareup.okhttp3:mockwebserver:4.9.1")
//oauth2
implementation ("org.springframework.boot:spring-boot-starter-oauth2-client")
implementation ("org.springframework.security:spring-security-oauth2-jose")
//etc
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0") //swagger
implementation("com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5") //암호화
implementation("org.springframework.boot:spring-boot-starter-mail") //mail 전송
implementation("org.springframework.boot:spring-boot-starter-data-redis") //redis
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// 아임포트(결제) 관련
implementation("com.github.iamport:iamport-rest-client-java:0.2.23")
//vault
implementation("org.springframework.cloud:spring-cloud-starter-bootstrap:4.1.4")
implementation("org.springframework.cloud:spring-cloud-config-server:4.1.3")
implementation("org.springframework.cloud:spring-cloud-starter-vault-config:4.1.3")
}
jacoco {
// JaCoCo 버전
toolVersion = "0.8.8"
// 테스트결과 리포트를 저장할 경로 변경
// default는 "${project.reporting.baseDir}/jacoco"
// reportsDir = file("$buildDir/customJacocoReportDir")
}
// kotlin DSL
tasks.jacocoTestReport {
reports {
// 원하는 리포트를 켜고 끌 수 있습니다.
// html.isEnabled = true
// xml.isEnabled = false
// csv.isEnabled = false
//.isEnabled 가 Deprecated 되었습니다 (저는 gradle 7.2 버전에 kotlin DSL 사용하고 있습니다)
html.required.set(true)
xml.required.set(false)
csv.required.set(false)
// 각 리포트 타입 마다 리포트 저장 경로를 설정할 수 있습니다.
// html.destination = file("$buildDir/jacocoHtml")
// xml.destination = file("$buildDir/jacoco.xml")
}
}
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
// 룰을 간단히 켜고 끌 수 있다.
enabled = true
// 룰을 체크할 단위는 클래스 단위
element = "CLASS"
// 메서드 커버리지를 최소한 00% 만족시켜야 한다.
limit {
counter = "METHOD"
value = "COVEREDRATIO"
minimum = "0.00".toBigDecimal()
}
// 라인 커버리지를 최소한 00% 만족시켜야 한다.
limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = "0.00".toBigDecimal()
}
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
finalizedBy("jacocoTestReport")
}
tasks.jacocoTestReport {
finalizedBy("jacocoTestCoverageVerification")
}