-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
180 lines (160 loc) · 6.27 KB
/
build.gradle
File metadata and controls
180 lines (160 loc) · 6.27 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.4'
id 'io.spring.dependency-management' version '1.1.7'
id 'jacoco'
}
group = 'org.example'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
jacoco {
// JaCoCo 버전
toolVersion = '0.8.11'
}
tasks.test {
useJUnitPlatform()
systemProperty "spring.profiles.active", "test"
finalizedBy tasks.jacocoTestReport
}
tasks.jacocoTestReport {
dependsOn tasks.test
reports {
html.required = true
xml.required = true
csv.required = false
}
// 커버리지에서 제외할 클래스가 있으면 여기서 패턴으로 제외
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'org/example/sansam/**/config/**',
'org/example/sansam/**/dto/**',
'org/example/sansam/cart/**/**',
'org/example/sansam/chat/**/**',
'org/example/sansam/exception/**/**',
'org/example/sansam/global/**/**',
'org/example/sansam/notification/**/**',
'org/example/sansam/product/**/**',
'org/example/sansam/review/**/**',
'org/example/sansam/s3/**/**',
'org/example/sansam/search/**/**',
'org/example/sansam/user/**/**',
'org/example/sansam/wish/**/**',
'org/example/sansam/wishlist/**/**',
'org/example/sansam/SanSamApplication*',
'**/Q*.*', '**/*$Q*.*',
'org/example/sansam/timedeal/**/**',
'org/example/sansam/stock/**/**',
'org/example/sansam/payment/util/IdempotencyKeyUtil.class'
])
})
)
}
jacocoTestCoverageVerification {
dependsOn test
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'org/example/sansam/**/config/**',
'org/example/sansam/**/dto/**',
'org/example/sansam/cart/**/**',
'org/example/sansam/chat/**/**',
'org/example/sansam/exception/**/**',
'org/example/sansam/global/**/**',
'org/example/sansam/notification/**/**',
'org/example/sansam/product/**/**',
'org/example/sansam/review/**/**',
'org/example/sansam/s3/**/**',
'org/example/sansam/search/**/**',
'org/example/sansam/user/**/**',
'org/example/sansam/wish/**/**',
'org/example/sansam/wishlist/**/**'
])
})
)
violationRules {
rule {
element = 'CLASS'
limit {
counter = 'INSTRUCTION'
value = 'COVEREDRATIO'
minimum = 0.80
}
}
}
}
tasks.check {
dependsOn tasks.jacocoTestCoverageVerification
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
// --- Spring Boot Starters ---
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// note: data-jpa가 jdbc/aop를 끌어오므로 별도 선언 불필요
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
// --- Infra / Clients ---
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0'
implementation 'co.elastic.clients:elasticsearch-java:8.11.2'
implementation 'org.elasticsearch.client:elasticsearch-rest-client:8.11.2'
implementation 'com.amazonaws:aws-java-sdk-ses:1.12.3'
implementation 'org.json:json:20240303'
implementation 'org.springframework.retry:spring-retry' // Boot BOM이 버전 관리
// --- QueryDSL (Jakarta) ---
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
// --- Lombok ---
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
// --- MapStruct ---
annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
implementation 'org.mapstruct:mapstruct:1.6.2'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.2'
// --- DB Driver ---
runtimeOnly 'com.mysql:mysql-connector-j'
// --- Test ---
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'com.h2database:h2'
testImplementation 'org.assertj:assertj-core:3.25.3'
testImplementation 'org.springframework.batch:spring-batch-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// spring batch
implementation 'org.springframework.boot:spring-boot-starter-batch'
testImplementation 'org.springframework.batch:spring-batch-test'
//jpa 쿼리 값 확인
// implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'
}
sourceSets {
main {
java {
srcDirs += "$buildDir/generated/sources/annotationProcessor/java/main"
}
}
test {
java {
srcDirs += "$buildDir/generated/sources/annotationProcessor/java/test"
}
}
}