-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
257 lines (215 loc) · 7.56 KB
/
build.gradle
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
plugins {
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.5'
id 'java'
id 'org.asciidoctor.jvm.convert' version "3.3.2"
id 'org.sonarqube' version '3.5.0.2730' // sonarqube gradle plugin 의존성
id 'jacoco' // jacoco gradle plugin 의존성
}
group = 'com.kustacks'
version = '2.6.4'
sourceCompatibility = '17'
configurations {
asciidoctorExtensions
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
sonarqube {
properties {
property "sonar.projectKey", "KU-Stacks_ku-ring-backend-web"
property "sonar.organization", "kuring1234"
property "sonar.host.url", "https://sonarcloud.io"
}
}
ext {
set('springAiVersion', "1.0.0-M1")
}
dependencies {
// Web
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.retry:spring-retry'
implementation 'org.springframework:spring-aspects'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
// AI
implementation "org.springframework.ai:spring-ai-openai-spring-boot-starter:${springAiVersion}"
implementation "org.springframework.ai:spring-ai-chroma-store-spring-boot-starter:${springAiVersion}"
// DB
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'
// QueryDsl
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
// password encoder
implementation 'org.springframework.security:spring-security-crypto:5.7.5'
// jwt
implementation 'io.jsonwebtoken:jjwt:0.9.1'
// monitoring
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'
// flyway
implementation 'org.flywaydb:flyway-mysql'
// DevTool
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// MockServer
implementation 'org.mock-server:mockserver-netty:5.11.2'
implementation 'org.mock-server:mockserver-client-java:5.11.2'
// Jsoup
implementation 'org.jsoup:jsoup:1.14.3'
// Firebase
implementation 'com.google.firebase:firebase-admin:9.3.0'
// RestDocs
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
// Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.rest-assured:rest-assured:5.3.2'
// ArchUnit
testImplementation 'com.tngtech.archunit:archunit-junit5:1.0.1'
// Test Container
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
testImplementation 'org.testcontainers:testcontainers:1.19.8'
testImplementation 'org.testcontainers:junit-jupiter:1.19.8'
testImplementation 'org.testcontainers:mariadb:1.19.8'
testImplementation 'org.testcontainers:chromadb:1.19.8'
testImplementation 'io.projectreactor:reactor-test'
}
dependencyManagement {
imports {
mavenBom "org.springframework.ai:spring-ai-bom:${springAiVersion}"
}
}
// Swagger force conflict resolution
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'io.swagger.core.v3') {
details.useVersion("2.2.19")
details.because('Swagger ui incoptable dependency io.swagger.core.v3:swagger-annotations')
}
}
}
}
test.onlyIf { System.getenv('DEPLOY_ENV') == 'dev' }
test {
jacoco {
destinationFile = file("$buildDir/jacoco/jacoco.exec")
}
useJUnitPlatform()
testLogging {
// test jvm의 standard out and standard error을 console에 출력한다.
showStandardStreams = true
showCauses = true
showExceptions = true
showStackTraces = true
exceptionFormat = 'full'
}
finalizedBy 'jacocoTestReport'
}
jar {
enabled = false
manifest {
attributes 'Main-Class': 'com.kustacks.kuring.KuringApplication'
}
}
// -- QueryDsl 설정 -------------------------------------------------------
//Querydsl 추가
def querydslSrcDir = 'src/main/generated'
clean {
delete file(querydslSrcDir)
}
tasks.withType(JavaCompile) {
options.generatedSourceOutputDirectory = file(querydslSrcDir)
}
// 자동 생성된 Q클래스 gradle clean으로 제거
clean {
delete file('src/main/generated')
}
// -- Jacoco 설정 -------------------------------------------------------
jacoco {
// jacoco version
toolVersion = '0.8.8'
}
jacocoTestReport {
dependsOn test
reports {
html.enabled true // 개발자용 html
xml.enabled true // 소나큐브용, 경로를 추가하지 않아도 sonarcloud가 default 경로를 인식
csv.enabled false
}
// QueryDSL은 분석에서 제외시켜야 함
def Qdomains = []
for (qPattern in '**/QA'..'**/QZ') {
Qdomains.add(qPattern + '*')
}
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
'**/*Request.*',
'**/*Response.*',
'**/dto/**',
'**/*Interceptor.*',
'**/*Exception.*',
'**/*Storage.*',
'**/KuringApplication.*',
'**/*Token.*',
'**/*Converter.*',
'**/*AdminController.*',
'**/*Dialect.*'
] + Qdomains)
})
)
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
def Qdomains = []
for (qPattern in '*.QA'..'*.QZ') {
Qdomains.add(qPattern + '*')
}
violationRules {
rule {
enabled = true // 활성화
limit {
element = 'CLASS'
minimum = 0.0
}
excludes = [
'**.*Request.*',
'**.*Response.*',
'**.*Dto.*',
'**.*Interceptor.*',
'**.*Exception.*',
'**.*Storage.*',
'**.KuringApplication.*',
'**.*Token.*',
'**.*Converter.*',
'**.*AdminController.*',
'**.*Dialect.*'
] + Qdomains
}
}
}
task testCoverage(type: Test) {
group 'verification'
description 'Runs the unit tests with coverage'
dependsOn(':test',
':jacocoTestReport',
':jacocoTestCoverageVerification')
tasks['jacocoTestReport'].mustRunAfter(tasks['test'])
tasks['jacocoTestCoverageVerification'].mustRunAfter(tasks['jacocoTestReport'])
}