-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
131 lines (112 loc) · 4.13 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
plugins {
id 'java'
id 'jacoco'
id 'org.sonarqube' version '4.4.1.3373'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
}
group = 'ac.dnd'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
implementation 'com.h2database:h2'
implementation 'org.projectlombok:lombok'
implementation 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.rest-assured:rest-assured'
testImplementation 'org.testcontainers:testcontainers:1.19.3'
testImplementation 'org.testcontainers:junit-jupiter:1.19.3'
testImplementation 'org.testcontainers:mysql:1.19.3'
testRuntimeOnly 'com.h2database:h2'
testAnnotationProcessor 'org.projectlombok:lombok'
//jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// JSON
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'net.minidev:json-smart:2.5.0'
//Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
//grafana, prometheus
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'
}
test {
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}
jacoco {
toolVersion = "0.8.12"
}
jacocoTestReport {
dependsOn test
reports {
html.required = true // 로컬에서 확인용으로 html 리포트 파일 생성
xml.required = true // SonarCloud로 전송하기 위해 XML 리포트 생성
csv.required = false
finalizedBy 'jacocoTestCoverageVerification'
}
}
jacocoTestCoverageVerification {
dependsOn jacocoTestReport
violationRules {
rule {
enabled = true // 이 rule을 적용할 것이다.
element = 'CLASS' // class 단위로
// 브랜치 커버리지 최소 60%
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.60
}
// 라인 커버리지 최소한 80%
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.80
}
// 빈 줄을 제외한 코드의 라인수 최대 300라인
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 300
}
// 커버리지 체크를 제외할 클래스들
excludes = [
'**.*Application*',
'**.*Config*',
'**.*Exception*',
'**.BaseEntity', // 임시로 추가
'**.*ControllerAdvice', // 임시로 추가
'**.*Request*', // 임시로 추가
'**.ApiResponse',
'**.*OAuthClient*',
'**.*Interceptor*',
"**.*Constants*",
"**.*Dto*",
]
}
}
}
sonar {
properties {
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', '5hseok'
property 'sonar.projectKey', '5hseok_DODAL_BE_SERVER'
property 'sonar.coverage.jacoco.xmlReportPaths', '${buildDir}/reports/jacoco/test/jacocoTestReport.xml'
}
}