-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
136 lines (107 loc) · 3.38 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
plugins {
id 'java'
id 'jacoco'
id 'org.springframework.boot' version '3.3.0'
id 'io.spring.dependency-management' version '1.1.5'
id "org.sonarqube" version '4.4.1.3373'
id "org.flywaydb.flyway" version "10.15.2"
id "com.diffplug.spotless" version "6.21.0"
}
group = 'com.quemistry'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '21'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
testCompile {
/* only junit 5 should be used */
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testRuntime {
/* only junit 5 should be used */
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.1.3'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'org.flywaydb:flyway-database-postgresql'
implementation 'org.flywaydb:flyway-core'
implementation 'org.javatuples:javatuples:1.2'
implementation 'org.springframework.boot:spring-boot-starter-cache'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
runtimeOnly "org.springframework.boot:spring-boot-starter-actuator"
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'com.h2database:h2'
testImplementation 'com.github.jsonzou:jmockdata:4.3.0'
testAnnotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
}
afterEvaluate {
excludedClassFilesForReport(classDirectories)
}
}
private excludedClassFilesForReport(classDirectories) {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/entity/*.class',
'**/model/**/*.class',
'**/model/*.class',
'**/entity/**/*.class',
'**/Application.class',
'**/constant/**/*.class',
'**/constant/*.class',
'com/quemistry/quiz_ms/exception/ExceptionResponse.class'
])
}))
}
bootJar {
archiveFileName = "quiz_ms.jar"
archiveClassifier.set(null)
}
tasks.register('installLocalGitHook', Copy) {
from new File(rootProject.rootDir, 'scripts/pre-commit')
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0775
}
build {
finalizedBy("installLocalGitHook")
}
sonar {
properties {
property "sonar.projectKey", "mtech-31-quemistry_quiz_ms"
property "sonar.organization", "mtech-31-quemistry"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.exclusions", "**/entity/*,**/model/**/*,**/model/*,**/entity/**/*,**/Application,**/constant/**/*,**/constant/*,com/quemistry/quiz_ms/exception/ExceptionResponse"
}
}
spotless {
java {
googleJavaFormat() // 使用 Google Java 格式化程序
}
}