-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
246 lines (204 loc) · 7.2 KB
/
Copy pathbuild.gradle
File metadata and controls
246 lines (204 loc) · 7.2 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
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
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.5'
id 'io.spring.dependency-management' version '1.1.6'
id 'jacoco' // jacoco
id 'org.sonarqube' version '4.4.1.3373'
}
group = 'org.myteam'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
// kafka
// implementation 'org.springframework.kafka:spring-kafka'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.apache.commons:commons-lang3:3.12.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// P6Spy 의존성 추가
implementation 'p6spy:p6spy:3.9.1'
implementation 'com.github.gavlyukovskiy:datasource-decorator-spring-boot-autoconfigure:1.9.0'
// spring boot mail 의존성 추가
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '3.3.4'
// h2 database
runtimeOnly 'com.h2database:h2'
// spring-boot-starter-validation
implementation 'org.springframework.boot:spring-boot-starter-validation'
// Jwt
implementation 'io.jsonwebtoken:jjwt:0.12.6'
//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"
// mysql-connector 추가
implementation group: 'com.mysql', name: 'mysql-connector-j', version: '8.3.0'
// imgscalr-lib
implementation group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2'
// commons-io
implementation 'commons-io:commons-io:2.14.0'
// Swagger
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.6.0'
// Minio
implementation 'io.minio:minio:8.5.11'
// S3
implementation(platform("software.amazon.awssdk:bom:2.21.1"))
implementation("software.amazon.awssdk:s3")
// TestContainer core
testImplementation "org.testcontainers:testcontainers:1.19.0"
testImplementation "org.testcontainers:junit-jupiter:1.19.0"
// TestContainer Image
testImplementation 'org.testcontainers:mysql:1.19.0'
testImplementation 'org.testcontainers:minio:1.19.7'
// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// Redisson
implementation 'org.redisson:redisson-spring-boot-starter:3.23.4'
//openfeign
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.1.3'
// thymeleaf
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
// cookie-session
implementation 'org.springframework.session:spring-session-core'
// prometheus
implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
}
test {
jvmArgs '-Xms512m', '-Xmx1024m', '-XX:+HeapDumpOnOutOfMemoryError', '-XX:HeapDumpPath=build/heapdump.hprof'
}
tasks.named('test') {
useJUnitPlatform()
// ignoreFailures = true // 테스트 실패해도 report 파일 생성.
// finalizedBy jacocoTestReport // Generates report after tests are run
finalizedBy tasks.named('jacocoTestReport')
}
/**
* QueryDSL Build Options
*/
def querydslDir = "src/main/generated"
sourceSets {
main.java.srcDir querydslDir
}
tasks.withType(JavaCompile) {
options.getGeneratedSourceOutputDirectory().set(file(querydslDir))
}
clean.doLast {
file(querydslDir).deleteDir()
}
/**
* Jacoco Build Options
*/
jacoco {
toolVersion = "0.8.10"
reportsDirectory = layout.buildDirectory.dir('jacocoReport')
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
csv.required = false
html.required = true
}
def Qdomains = []
for (qPattern in '**/QA'..'**/QZ') { // qPattern = '**/QA', '**/QB', ... '*.QZ'
Qdomains.add(qPattern + '*')
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/dto/**',
'**/domain/**',
'**/entity/**',
'**/util/**',
'**/repository/**',
'**/controller/**',
'**/aop/**',
'**/exception/**',
'**/config/**',
"**/core/**",
"**/factory/**",
"**/strategy/**",
"**/global/**",
"**/oauth2/**",
"**/chat/**",
"**/upload/**",
"**/recommend/**",
'**/MemberRole*',
'**/SecurityReadService*'
] + Qdomains)
}))
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
def Qdomains = []
for (qPattern in '*.QA'..'*.QZ') { // qPattern = '*.QA', '*.QB', ... '*.QZ'
Qdomains.add(qPattern + '*')
}
violationRules {
rule {
enabled = true;
element = 'CLASS'
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.80
}
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.80
}
excludes = [
'**/dto/**',
'**/domain/**',
'**/entity/**',
'**/util/**',
'**/repository/**',
'**/controller/**',
'**/aop/**',
'**/exception/**',
'**/config/**',
"**/core/**",
"**/factory/**",
"**/strategy/**",
"**/global/**",
"**/oauth2/**",
"**/chat/**",
"**/upload/**",
"**/recommend/**",
'**/MemberRole*',
'**/SecurityReadService*'
] + Qdomains
}
}
}
// SonarCloud config
sonar {
properties {
property "sonar.projectKey", "MT-TEAM-Org_server"
property "sonar.organization", "playhive-static-analyze"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}
}