-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
262 lines (201 loc) · 9.17 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'checkstyle'
id 'pmd'
id 'jacoco'
id 'org.owasp.dependencycheck' version '10.0.3'
}
def buildNumber = System.getenv("RELEASE_VERSION")?.replace("refs/tags/", "") ?: "DEV-SNAPSHOT"
group 'com.github.hmcts'
// Do not change this version number
version buildNumber
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' }
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
// region static code analysis
checkstyle {
toolVersion = "9.3"
}
pmd {
toolVersion = "6.55.0"
ignoreFailures = true
sourceSets = [sourceSets.main, sourceSets.test]
reportsDir = layout.buildDirectory.dir("reports/pmd").get().asFile
ruleSetFiles = files("config/pmd/ruleset.xml")
}
// https://jeremylong.github.io/DependencyCheck/dependency-check-gradle/configuration.html
dependencyCheck {
// Specifies if the build should be failed if a CVSS score above a specified level is identified.
// range of 7-10 fails the build, anything lower and it doesn't fail the build
failBuildOnCVSS = 7.0
suppressionFile = 'config/owasp/suppressions.xml'
nvd {
validForHours = 24
delay = 8000
apiKey = System.getenv("NVD_API_KEY")
}
analyzers {
retirejs {
enabled = false
}
ossIndex {
enabled = false
}
// Disable scanning of .NET related binaries
assemblyEnabled = false
}
}
// endregion
// region test coverage
jacoco {
toolVersion = "0.8.10"
}
jacocoTestReport {
reports {
xml.required = true
csv.required = false
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}
// endregion
// region publishing
tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
dependsOn javadoc
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
Main(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId 'sscs-common'
version project.version
}
}
}
tasks.register('installLocalGitHook', Copy) {
from new File(rootProject.rootDir, 'config/git/pre-commit')
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0775
}
compileJava.dependsOn installLocalGitHook
tasks.register('runGitPreCommitTasks') {
dependsOn 'test'
dependsOn 'pmdMain'
dependsOn 'pmdTest'
dependsOn 'dependencyCheckAggregate'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
def versions = [
springboot : '2.7.18',
jackson : '2.17.2',
junitjupiter : '5.10.0',
lombok : '1.18.28'
]
dependencies {
api group: 'com.google.guava', name: 'guava', version: '32.1.1-jre'
api group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.springframework.boot', name: 'spring-boot', version: versions.springboot
implementation group: 'org.springframework', name: 'spring-webmvc', version: '5.3.32'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: versions.jackson
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: versions.jackson
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: versions.jackson
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: versions.jackson
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: versions.jackson
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1', {
exclude group: 'junit', module: 'junit'
}
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '9.40'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.14'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.4.14'
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.7.0'
implementation group: 'com.github.everit-org.json-schema', name: 'org.everit.json.schema', version: '1.14.3', {
exclude group: 'commons-collections', module: 'commons-collections'
}
implementation group: 'org.elasticsearch', name: 'elasticsearch', version: '7.17.11'
implementation group: 'org.springframework.retry', name: 'spring-retry', version: '1.3.1'
implementation group: 'io.github.openfeign.form', name: 'feign-form', version: '3.8.0'
implementation group: 'com.github.hmcts', name: 'java-logging', version: '6.0.1'
implementation group: 'com.github.hmcts', name: 'ccd-client', version: '4.9.2', {
exclude group: 'org.springframework.cloud', module: 'spring-cloud-starter-openfeign'
}
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: versions.springboot
implementation group: 'com.github.hmcts', name: 'service-auth-provider-java-client', version: '4.1.2', {
exclude group: 'org.springframework.cloud', module: 'spring-cloud-starter-openfeign'
}
implementation group: 'com.github.hmcts', name: 'idam-java-client', version: '2.1.1', {
exclude group: 'org.springframework.cloud', module: 'spring-cloud-starter-openfeign'
}
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '4.0.6', {
exclude group: 'org.springframework.cloud', module: 'spring-cloud-starter'
exclude group: 'org.springframework.cloud', module: 'spring-cloud-commons'
}
implementation group: 'com.github.sps.junidecode', name: 'junidecode', version: '0.3'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.2.3'
implementation group: 'com.googlecode.libphonenumber', name: 'libphonenumber', version: '8.13.17'
// https://mvnrepository.com/artifact/com.opencsv/opencsv
implementation group: 'com.opencsv', name: 'opencsv', version: '5.7.1', {
exclude group: 'commons-collections', module: 'commons-collections'
}
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'
implementation group: 'commons-io', name: 'commons-io', version: '2.16.1'
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
implementation group: "com.networknt", name: "json-schema-validator", version: "1.0.86"
implementation group: 'org.projectlombok', name: 'lombok', version: versions.lombok
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.0'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springboot
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-aop', version: versions.springboot
implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junitjupiter
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junitjupiter
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: versions.junitjupiter
testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: versions.junitjupiter
testImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: '1.10.0'
testImplementation group: 'org.junit.platform', name: 'junit-platform-engine', version: '1.10.0'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.4.0'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.24.2'
testImplementation group: 'org.skyscreamer', name: 'jsonassert', version: '1.5.1'
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.1'
testRuntimeOnly group: 'org.glassfish', name: 'jakarta.el', version: '3.0.4'
testRuntimeOnly group: 'org.hibernate.validator', name: 'hibernate-validator', version: '6.2.5.Final'
testImplementation group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
// CVE-2023-24998
implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.5'
// CVE-2024-25710
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.26.0'
// CVE-2023-2976, CVE-2020-8908
checkstyle group: 'com.puppycrawl.tools', name: 'checkstyle', version: checkstyle.toolVersion
checkstyle group: 'com.google.guava', name: 'guava', version: '32.1.1-jre'
}