-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
155 lines (130 loc) · 4.34 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.10'
id 'io.spring.dependency-management' version '1.1.6'
id "org.sonarqube" version "5.1.0.4882"
id 'jacoco'
}
group = 'studio'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
jar {
enabled = false
}
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'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
// implementation 'org.springframework.boot:spring-boot-starter-validation'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
// s3
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
// JWT
implementation 'com.auth0:java-jwt:3.13.0'
// modelmapper
implementation 'org.modelmapper:modelmapper:3.1.1'
// lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// database
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
//SMTP
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '3.0.5'
implementation 'jakarta.mail:jakarta.mail-api:2.1.2'
// swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.4'
// SonarQube
implementation 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3'
// Jasypt
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5'
// spring-test 라이브러리 추가
implementation 'org.springframework:spring-test:6.1.13'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
sonar {
properties {
// property "sonar.projectName", System.getenv('SONARQUBE_SERVER')
// property "sonar.projectKey", System.getenv('SONARQUBE_TOKEN')
// property "sonar.hostUrl", System.getenv('SONARQUBE_HOST_URL')
property "sonar.projectName", "studio-eye-sonar"
property "sonar.projectKey", "studio-eye-sonar"
// property "sonar.hostUrl", "http://3.36.218.65:9000"
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport // Generates report after tests are run
}
// JaCoCo configuration
jacoco {
toolVersion = "0.8.11"
reportsDirectory = layout.buildDirectory.dir('jacocoReport')
}
jacocoTestReport {
dependsOn test // 테스트가 실행된 후 커버리지 리포트 생성
reports {
xml.required.set(false)
csv.required.set(true)
html.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, includes: [
"studio/studioeye/domain/**/application/**"
])
})
)
}
}
jacocoTestCoverageVerification {
// QueryDSL QDomain 제외시키기
def QDomains = []
// qPattern = "*.QA","*.QB","*.QC", ... "*.QZ"
for (qPattern in '*.QA'..'*.QZ') {
QDomains.add(qPattern + '*')
}
violationRules {
rule {
// rule 활성화
enabled = true
// 클래스 단위로 룰 체크
element = 'CLASS'
// 라인 커버리지를 최소 80% 만족
// limit {
// counter = 'LINE'
// value = 'COVEREDRATIO'
// minimum = 0.80
// }
// 마찬가지로 제거 대상 지정
excludes = [
"co.kirikiri.domain.**.**",
"**.*Application*",
"**.*Config*",
"**.*Interceptor*",
"**.*Exception*",
"**.*Controller*",
"**.*Repository*",
"**.*Dto*"
]
}
}
}