-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
183 lines (153 loc) · 4.63 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
// queryDSL
buildscript {
ext {
queryDslVersion = "5.0.0"
}
}
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.13'
id 'io.spring.dependency-management' version '1.1.0'
// queryDSL
id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10'
//sonarCloud
id "org.sonarqube" version "4.4.1.3373"
//jacoco
id 'jacoco'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sonar {
properties {
property "sonar.projectKey", "PLADI-ALM_PLADI-ALM-Server"
property "sonar.organization", "pladi-alm"
property "sonar.host.url", "https://sonarcloud.io"
property 'sonar.sources', 'src'
property 'sonar.language', 'java'
property 'sonar.sourceEncoding', 'UTF-8'
property "sonar.exclusions", "**/*Application*.java" // Application 파일은 분석 대상에서 제외
property "sonar.java.coveragePlugin", "jacoco"
property 'sonar.coverage.jacoco.xmlReportPaths', 'build/reports/jacoco/test/jacocoTestReport.xml'
}
}
java {
sourceCompatibility = '11'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.6.5'
runtimeOnly 'com.mysql:mysql-connector-j'
// jasypt
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.3'
// queryDSL
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
implementation "com.querydsl:querydsl-apt:${queryDslVersion}"
// Swagger3 gradle
implementation 'io.springfox:springfox-boot-starter:3.0.0'
implementation("io.swagger:swagger-annotations:1.5.21")
implementation("io.swagger:swagger-models:1.5.21")
//feignClient
implementation "org.springframework.cloud:spring-cloud-starter-openfeign:3.1.1"
compileOnly "org.springframework.cloud:spring-cloud-starter-openfeign:3.1.1"
// jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'
// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// spring security
implementation 'org.springframework.boot:spring-boot-starter-security'
// verify email
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '2.6.3'
// random
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
// thymeleaf
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
// firebase
implementation 'com.google.firebase:firebase-admin:6.8.1'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2'
//테스트용 H2
implementation 'com.h2database:h2'
//spring security test
testImplementation 'org.springframework.security:spring-security-test:5.3.3.RELEASE'
}
tasks.named('test') {
useJUnitPlatform()
}
ext {
snippetsDir = file('build/generated-snippets')
}
jacocoTestReport {
reports {
xml.required = true
html.required = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"**/*Application*",
"**/config/*"
])
}))
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true // rule을 on/off
element = "CLASS" // class 단위로 rule 체크
limit { // 라인 커버리지 최소 80% 충족
counter = "LINE"
value = "COVEREDRATIO"
minimum = "0.80".toBigDecimal()
}
limit {// 빈 줄 제외한 코드 라인수 최대 1000라인으로 제한
counter = "LINE"
value = "TOTALCOUNT"
maximum = "1000.0".toBigDecimal()
}
}
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"**/*Application*",
"**/config/*"
])
}))
}
}
//querydsl 추가
def querydslDir = "$buildDir/generated/querydsl"
querydsl {
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets {
main.java.srcDir querydslDir
}
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
querydsl.extendsFrom compileClasspath
}