-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (138 loc) · 3.19 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.39")
}
}
plugins {
id 'java'
id 'jacoco'
id 'org.springframework.boot' version '3.1.2'
id 'io.spring.dependency-management' version '1.1.2'
id 'org.sonarqube' version '4.0.0.2929'
}
apply plugin: 'io.spring.javaformat'
group = 'code.shubham'
version = '0.0.1'
java {
sourceCompatibility = '20'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
}
repositories {
mavenCentral()
}
dependencies {
annotationProcessor (
'org.springframework.boot:spring-boot-configuration-processor',
'org.projectlombok:lombok',
)
compileOnly (
'org.projectlombok:lombok',
)
developmentOnly (
'org.springframework.boot:spring-boot-devtools',
)
implementation(
'org.springframework.boot:spring-boot-starter-actuator',
'org.springframework.boot:spring-boot-starter-log4j2',
'com.lmax:disruptor:3.3.6',
'io.sentry:sentry-spring-boot-starter-jakarta:6.28.0',
'com.google.code.gson:gson:2.8.9',
'org.springframework.boot:spring-boot-starter-data-jpa',
'org.springframework.boot:spring-boot-starter-webflux',
'org.springframework.boot:spring-boot-starter-web',
'org.springframework.kafka:spring-kafka',
)
runtimeOnly (
'com.mysql:mysql-connector-j',
'io.micrometer:micrometer-registry-prometheus',
)
testImplementation (
'org.springframework.boot:spring-boot-starter-test',
'io.projectreactor:reactor-test',
'org.springframework.kafka:spring-kafka-test',
)
}
tasks.named('test') {
useJUnitPlatform()
}
tasks.withType(io.spring.javaformat.gradle.tasks.CheckFormat) {
exclude "package/to/exclude"
}
jacoco {
toolVersion = "0.8.9"
reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir')
}
jacocoTestReport {
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.0
}
}
rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}
javadoc {
failOnError true
}
springBoot {
buildInfo()
}
test {
jacoco {
enabled = true
destinationFile = layout.buildDirectory.file("jacoco/${name}.exec").get().asFile
includes = []
excludes = []
excludeClassLoaders = []
includeNoLocationClasses = false
sessionId = "<auto-generated value>"
dumpOnExit = true
classDumpDir = null
output = JacocoTaskExtension.Output.FILE
address = "localhost"
port = 6300
jmx = false
}
}
sonarqube {
properties {
property 'sonar.host.url', 'http://localhost:9017'
property "sonar.login", ""
property "sonar.password", ""
property "sonar.projectKey", "project:service"
property 'sonar.projectName', 'server-sent-events'
property 'sonar.java.source', 20
property 'sonar.junit.reportPaths', 'build/results'
property 'encoding', 'UTF-8'
property 'charSet', 'UTF-8'
property "sonar.coverage.jacoco.xmlReportPaths", "path.xml"
}
}
tasks['sonarqube'].dependsOn jacocoTestReport