-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
652 lines (543 loc) · 26.7 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath("net.serenity-bdd:serenity-gradle-plugin:2.4.34")
}
}
plugins {
id 'application'
id 'uk.gov.hmcts.java' version '0.12.63'
id 'jacoco'
id 'pmd'
id 'com.github.ben-manes.versions' version '0.51.0'
id "info.solidsoft.pitest" version '1.15.0'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.sonarqube' version '5.1.0.4882'
id 'org.springframework.boot' version '3.3.4'
id "org.flywaydb.flyway" version "9.22.3"
id 'au.com.dius.pact' version '4.1.7'// do not change, otherwise serenity report fails
id 'org.owasp.dependencycheck' version '10.0.3'
}
apply plugin: 'java'
apply plugin: 'net.serenity-bdd.aggregator'
apply plugin: 'project-report'
apply plugin: 'idea'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
ext {
springCloudVersion = '2023.0.3'
}
def versions = [
junit : '5.10.3',
junitPlatform : '1.10.3',
lombok : '1.18.22',
gradlePitest : '1.15.0',
pitest : '1.16.1',
sonarPitest : '0.5',
junitPitest : '1.2.1',
reformLogging : '6.1.5',
serenity : '2.0.76',
springHystrix : '2.2.10.RELEASE',
pact_version : '4.6.11',
launchDarklySdk : '5.10.9',
log4j : '2.23.1',
jackson : '2.17.2',
feign : '3.8.0',
reformS2sClient : '5.1.3',
testContainer_postgresql: '1.20.0',
bouncycastle : '1.78.1',
logback : '1.2.13',
okio : '3.4.0'
]
mainClassName = 'uk.gov.hmcts.reform.userprofileapi.Application'
def jarName = 'rd-user-profile-api.jar'
group = 'uk.gov.hmcts.reform'
version = '0.0.1'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.75
}
}
}
}
compileJava {
options.compilerArgs << '-parameters' << '-Xlint:deprecation' << "-Xlint:unchecked" << "-Werror"
}
compileTestJava {
options.compilerArgs << '-Xlint:deprecation' << "-Xlint:unchecked" << "-Werror"
}
tasks.withType(JavaExec).configureEach {
javaLauncher.set(javaToolchains.launcherFor(java.toolchain))
}
tasks.withType(Test) {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integrationTest/java')
}
resources.srcDir file('src/integrationTest/resources')
}
functionalTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/functionalTest/java')
}
resources.srcDir file('src/functionalTest/resources')
}
smokeTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/smokeTest/java')
}
resources.srcDir file('src/smokeTest/resources')
}
contractTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/contractTest/java')
}
resources.srcDir file('src/contractTest/resources')
}
pactTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/pactTest/java')
}
resources.srcDir file('src/pactTest/resources')
}
fortifyTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/Test/java')
}
resources.srcDir file('src/test/resources')
}
}
idea {
module {
testSourceDirs += project.sourceSets.integrationTest.java.srcDirs
testSourceDirs += project.sourceSets.integrationTest.resources.srcDirs
testSourceDirs += project.sourceSets.functionalTest.java.srcDirs
testSourceDirs += project.sourceSets.functionalTest.resources.srcDirs
testSourceDirs += project.sourceSets.smokeTest.java.srcDirs
testSourceDirs += project.sourceSets.smokeTest.resources.srcDirs
}
}
configurations {
integrationTestImplementation.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
functionalTestImplementation.extendsFrom testCompile
functionalTestRuntimeOnly.extendsFrom testRuntime
contractTestImplementation.extendsFrom testCompile
contractTestRuntimeOnly.extendsFrom testRuntime
pactTestImplementation.extendsFrom testCompile
pactTestRuntime.extendsFrom testRuntime
fortifyTestImplementation.extendsFrom testCompile
fortifyTestRuntimeOnly.extendsFrom testRuntime
testCompile.exclude group: 'ch.qos.logback', module: 'logback-classic'
testCompile.exclude group: 'ch.qos.logback', module: 'logback-core'
compile.exclude group: 'ch.qos.logback', module: 'logback-classic'
compile.exclude group: 'ch.qos.logback', module: 'logback-core'
}
pmd {
toolVersion = "6.55.0"
ignoreFailures = true
sourceSets = [sourceSets.main, sourceSets.test, sourceSets.integrationTest, sourceSets.functionalTest, sourceSets.smokeTest]
reportsDir = file("$project.buildDir/reports/pmd")
ruleSets = [
'category/java/errorprone.xml',
'category/java/bestpractices.xml'
]
}
task integration(type: Test, description: 'Runs the integration tests.', group: 'Verification') {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
task functional(type: Test, description: 'Runs the functional tests.', group: 'Verification') {
systemProperty "scenario", System.getProperty('scenario')
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
finalizedBy aggregate
}
task smoke(type: Test, description: 'Runs the smoke tests.', group: 'Verification') {
testClassesDirs = sourceSets.smokeTest.output.classesDirs
classpath = sourceSets.smokeTest.runtimeClasspath
finalizedBy aggregate
//maxParallelForks = (Runtime.runtime.availableProcessors().intdiv(2) >= 2) ? 2 : 1
}
task migratePostgresDatabase(type: org.flywaydb.gradle.task.FlywayMigrateTask) {
baselineOnMigrate = true
if (project.hasProperty("dburl")) {
url = "jdbc:postgresql://${dburl}"
}
}
//PACT CONFIGURATION
project.ext {
pactVersion = getCheckedOutGitCommitHash()
}
def getCheckedOutGitCommitHash() {
'git rev-parse --verify --short HEAD'.execute().text.trim()
}
task contract(type: Test) {
description = 'Runs the consumer Pact tests'
useJUnitPlatform()
testClassesDirs = sourceSets.contractTest.output.classesDirs
classpath = sourceSets.contractTest.runtimeClasspath
include "uk/gov/hmcts/reform/userprofileapi/**"
}
task runAndPublishConsumerPactTests(type: Test, description: 'Publish pact test to broker.', group: 'Verification') {
testClassesDirs = sourceSets.contractTest.output.classesDirs
classpath = sourceSets.contractTest.runtimeClasspath
}
runAndPublishConsumerPactTests.finalizedBy pactPublish
pact {
publish {
pactDirectory = 'pacts'
tags = [System.getenv("PACT_BRANCH_NAME") ?: 'Dev']
version = project.pactVersion
}
}
//Provider PACT tasks
task contractTest(type: Test) {
logger.lifecycle("Runnning contract Tests")
useJUnitPlatform()
testClassesDirs = sourceSets.contractTest.output.classesDirs
classpath = sourceSets.contractTest.runtimeClasspath
exclude "uk/gov/hmcts/reform/userprofileapi/*IdamConsumerTest*"
}
task runProviderPactVerification(type: Test) {
description = 'Runs the provider Pact tests'
useJUnitPlatform()
testClassesDirs = sourceSets.contractTest.output.classesDirs
classpath = sourceSets.contractTest.runtimeClasspath
if (project.hasProperty('pact.verifier.publishResults')) {
systemProperty 'pact.verifier.publishResults', project.property('pact.verifier.publishResults')
}
systemProperty 'pact.provider.version', project.pactVersion
include "uk/gov/hmcts/reform/userprofileapi/**"
}
task fortifyScan(type: JavaExec) {
mainClass.set("uk.gov.hmcts.fortifyclient.FortifyClientMainApp")
classpath += sourceSets.fortifyTest.runtimeClasspath
jvmArgs = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED']
// This is a temporary fix to prevent the nightly build from failing if the Fortify scan detects issues
ignoreExitValue = true
}
runProviderPactVerification.dependsOn contractTest
runProviderPactVerification.finalizedBy pactVerify
jacoco {
toolVersion = "0.8.12"
}
jacocoTestReport {
executionData(test, integration)
reports {
xml.required = true
csv.required = false
xml.outputLocation = file("${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml")
}
}
pitest {
pitestVersion = versions.pitest
junit5PluginVersion = versions.junitPitest
targetClasses = ['uk.gov.hmcts.reform.userprofileapi.*']
excludedClasses = [
'uk.gov.hmcts.reform.userprofileapi.config.*',
'uk.gov.hmcts.reform.userprofileapi.Application',
'uk.gov.hmcts.reform.userprofileapi.controller.*'
]
threads = 10
outputFormats = ['XML', 'HTML']
timestampedReports = false
mutationThreshold = 85
}
project.tasks['pitest'].group = "Verification"
sonarqube {
properties {
property "sonar.projectName", "RD :: User Profile API"
property "sonar.projectKey", "RDUSERPROFILEAPI"
property "sonar.coverage.jacoco.xmlReportPaths", "${jacocoTestReport.reports.xml.outputLocation}"
property "sonar.pitest.mode", "reuseReport"
property "sonar.pitest.reportsDirectory", "build/reports/pitest"
property "sonar.exclusions", "src/main/java/uk/gov/hmcts/reform/userprofileapi/config/**," +
"src/main/java/uk/gov/hmcts/reform/userprofileapi/SystemDateProvider.java," +
"src/main/java/uk/gov/hmcts/reform/userprofileapi/Application.java," +
"src/main/java/uk/gov/hmcts/reform/userprofileapi/util/JsonFeignResponseHelper.java," +
"src/main/java/uk/gov/hmcts/reform/userprofileapi/domain/**"
}
}
project.tasks['sonarqube'].dependsOn test, integration, jacocoTestReport
project.tasks['sonarqube'].group = "Verification"
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
configurations.all {
exclude group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j'
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'ch.qos.logback', module: 'logback-core'
exclude group: "org.codehaus.groovy", module: "groovy"
exclude group: "org.codehaus.groovy", module: "groovy-xml"
exclude group: "org.codehaus.groovy", module: "groovy-json"
}
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: '3.1.0'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-aop'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-json'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'
implementation (group: 'org.springframework.boot', name: 'spring-boot-starter-web'){
exclude group: 'org.glassfish', module: 'jakarta.el'
}
implementation group: 'org.springframework.retry', name: 'spring-retry', version: '1.3.2'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-cache'
implementation group: 'commons-lang', name: 'commons-lang', version: '2.6'
implementation group: 'org.springframework', name: 'spring-core'
implementation group: 'org.springframework', name: 'spring-beans'
implementation group: 'org.springframework', name: 'spring-aop'
implementation group: 'org.springframework', name: 'spring-aspects'
implementation group: 'org.springframework', name: 'spring-context'
implementation group: 'org.springframework', name: 'spring-context-support'
implementation group: 'org.springframework', name: 'spring-expression'
implementation group: 'org.springframework', name: 'spring-jcl'
implementation group: 'org.springframework', name: 'spring-jdbc'
implementation group: 'org.springframework', name: 'spring-orm'
implementation group: 'org.springframework', name: 'spring-tx'
implementation group: 'org.springframework', name: 'spring-web'
implementation group: 'org.springframework', name: 'spring-webmvc'
implementation group: 'org.springframework.security', name: 'spring-security-core'
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.6.0'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap'
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.8.0'
implementation group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: versions.bouncycastle
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: '2.8.5'
implementation group: 'io.github.openfeign', name: 'feign-okhttp', version: '11.10'
implementation group: 'com.sun.xml.bind', name: 'jaxb-osgi', version: '4.0.5'
implementation group: 'com.github.hmcts', name: 'service-auth-provider-java-client', version: versions.reformS2sClient
implementation group: 'com.auth0', name: 'java-jwt', version: '4.4.0'
implementation group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: versions.launchDarklySdk
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind'
implementation group: 'com.fasterxml.jackson', name: 'jackson-bom', version: versions.jackson, ext: 'pom'
implementation group: 'io.jsonwebtoken', name: 'jjwt', version:'0.9.1'
implementation group: 'jakarta.inject', name: 'jakarta.inject-api', version: '1.0.5'
implementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '6.1.0'
implementation 'com.github.hmcts:idam-java-client:3.0.3'
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '9.40'
implementation ('org.springframework.boot:spring-boot-starter-validation'){
exclude group: 'org.glassfish', module: 'jakarta.el'
}
//Fix for CVE-2021-29425
implementation 'commons-io:commons-io:2.16.1'
implementation group: 'org.flywaydb', name: 'flyway-core', version: '9.22.3'
implementation group: 'org.postgresql', name: 'postgresql', version: '42.7.3'
implementation group: 'jakarta.el', name: 'jakarta.el-api', version: '5.0.1'
implementation group: 'com.google.guava', name: 'guava', version: '32.1.3-jre'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: versions.log4j
implementation group: 'org.apache.logging.log4j', name: 'log4j', version: versions.log4j
implementation group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: versions.log4j
implementation group: 'com.microsoft.azure', name: 'applicationinsights-runtime-attach', version: '3.5.3'
implementation group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '3.5.3'
testImplementation group: 'org.testcontainers', name: 'postgresql', version: versions.testContainer_postgresql
testImplementation group: 'org.testcontainers', name: 'junit-jupiter', version: versions.testContainer_postgresql
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: versions.testContainer_postgresql
testImplementation ("org.mockito:mockito-core:4.11.0") {
exclude group: "net.bytebuddy", module: "byte-buddy"
exclude group: "net.bytebuddy", module: "byte-buddy-agent"
}
testImplementation ("org.mockito:mockito-inline:4.11.0") {
exclude group: "net.bytebuddy", module: "byte-buddy"
exclude group: "net.bytebuddy", module: "byte-buddy-agent"
}
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.14.18'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.14.18'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '4.11.0'
testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.9'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: versions.log4j
implementation "com.github.hmcts.java-logging:logging:${versions.reformLogging}"
implementation "com.github.hmcts.java-logging:logging-appinsights:${versions.reformLogging}"
testImplementation ('com.github.hmcts:rd-commons-lib:0.0.18'){
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-web'
}
compileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
integrationTestCompileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
integrationTestAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
functionalTestCompileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
functionalTestAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
smokeTestCompileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
smokeTestAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testImplementation("org.hamcrest:hamcrest-junit:2.0.0.0") {
exclude group: "org.hamcrest", module: "hamcrest-core"
exclude group: "org.hamcrest", module: "hamcrest-library"
}
testImplementation("com.github.tomakehurst:wiremock-jre8-standalone:3.0.1") {
exclude group: 'com.github.jknack'
}
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', {
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation group: 'org.pitest', name: 'pitest', version: versions.pitest
testImplementation group: 'info.solidsoft.gradle.pitest', name: 'gradle-pitest-plugin', version: versions.gradlePitest
testImplementation group: 'org.pitest', name: 'pitest-junit5-plugin', version: versions.junitPitest
testImplementation group: 'org.codehaus.sonar-plugins', name: 'sonar-pitest-plugin', {
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}, version: versions.sonarPitest
testImplementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.12.0'
testImplementation group: 'com.github.mifmif', name: 'generex', version: '1.0.2'
fortifyTestRuntimeOnly 'com.github.hmcts:fortify-client:1.4.3:all'
contractTestImplementation group: 'au.com.dius.pact.provider', name: 'junit5', version: versions.pact_version
contractTestImplementation group: 'au.com.dius.pact.provider', name: 'spring', version: versions.pact_version
contractTestImplementation group: 'au.com.dius.pact.provider', name: 'junit5spring', version: versions.pact_version
testImplementation 'net.serenity-bdd:serenity-rest-assured:3.8.1'
testImplementation group: 'net.serenity-bdd', name: 'serenity-junit', version: '3.8.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: versions.junit
functionalTestImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
functionalTestRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
functionalTestImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: versions.junit
functionalTestImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: versions.junitPlatform
functionalTestRuntimeOnly group: 'org.junit.platform', name: 'junit-platform-engine', version: versions.junitPlatform
smokeTestImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
smokeTestRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
smokeTestImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: versions.junit
smokeTestImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: versions.junitPlatform
smokeTestRuntimeOnly group: 'org.junit.platform', name: 'junit-platform-engine', version: versions.junitPlatform
integrationTestImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
integrationTestRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
integrationTestImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: versions.junit
integrationTestImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: versions.junitPlatform
integrationTestRuntimeOnly group: 'org.junit.platform', name: 'junit-platform-engine', version: versions.junitPlatform
contractTestImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
contractTestRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
contractTestImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: versions.junit
contractTestImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: versions.junitPlatform
contractTestRuntimeOnly group: 'org.junit.platform', name: 'junit-platform-engine', version: versions.junitPlatform
contractTestImplementation('org.scala-lang:scala-library:2.13.14')
integrationTestImplementation sourceSets.main.runtimeClasspath
integrationTestImplementation sourceSets.test.runtimeClasspath
functionalTestImplementation sourceSets.main.runtimeClasspath
functionalTestImplementation sourceSets.test.runtimeClasspath
smokeTestImplementation sourceSets.main.runtimeClasspath
smokeTestImplementation sourceSets.test.runtimeClasspath
contractTestImplementation sourceSets.main.runtimeClasspath
contractTestImplementation sourceSets.test.runtimeClasspath
pactTestImplementation sourceSets.main.runtimeClasspath
pactTestImplementation sourceSets.test.runtimeClasspath
fortifyTestImplementation sourceSets.main.runtimeClasspath
fortifyTestImplementation sourceSets.test.runtimeClasspath
}
rootProject.tasks.named("processFunctionalTestResources") {
duplicatesStrategy = 'include'
}
rootProject.tasks.named("processIntegrationTestResources") {
duplicatesStrategy = 'include'
}
// 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 0-10 fails the build, anything greater and it doesn't fail the build
failBuildOnCVSS = System.getProperty('dependencyCheck.failBuild') == 'true' ? 0 : 11
suppressionFile = 'config/owasp/suppressions.xml'
analyzers {
// Disable scanning of .NET related binaries
assemblyEnabled = false
}
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
gradle.startParameter.continueOnFailure = true
bootJar {
loaderImplementation = org.springframework.boot.loader.tools.LoaderImplementation.CLASSIC
archiveFileName = jarName
manifest {
attributes('Implementation-Version': project.version.toString())
}
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'org.bouncycastle'
&& (details.requested.name == 'bcpkix-jdk18on'
|| details.requested.name == 'bcprov-jdk18on')
){
details.useVersion versions.bouncycastle
}
if (details.requested.group == 'com.squareup.okio'
&& details.requested.name == 'okio') {
details.useVersion versions.okio
}
}
resolutionStrategy.eachDependency { details ->
// Remedy for CVE-2024-22233 - remove once spring-boot transitively uses version >= 6.1.14
if (details.requested.group == 'org.springframework'
&& (details.requested.version == '6.1.12' || details.requested.version == '6.1.13')) {
details.useVersion "6.1.14"
}
}
}
dependencies {
modules {
module("org.bouncycastle:bcpkix-jdk15on") {
replacedBy("org.bouncycastle:bcpkix-jdk18on")
}
module("org.bouncycastle:bcprov-jdk15on") {
replacedBy("org.bouncycastle:bcprov-jdk18on")
}
}
}
// this is required to force Java running on the Azure Windows Server OS into using
// UTF-8 as the default character set instead of windows-1252 which causes issues.
// this setting only applies when running via gradle bootRun -- see web.config for the
// java flag that configures the deployed applications
applicationDefaultJvmArgs = ["-Dfile.encoding=UTF-8"]