generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
201 lines (167 loc) · 6.25 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
plugins {
id 'application'
id 'checkstyle'
id 'jacoco'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '2.7.9'
id 'org.owasp.dependencycheck' version '8.1.2'
id 'com.github.ben-manes.versions' version '0.45.0'
id 'org.sonarqube' version '4.0.0.2929'
}
group = 'uk.gov.hmcts.reform'
version = '0.0.1'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
def versions = [
junit : '5.7.0',
junitPlatform: '1.8.1',
lombok : '1.18.26'
]
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Werror"
}
// https://github.com/gradle/gradle/issues/16791
tasks.withType(JavaExec).configureEach {
javaLauncher.set(javaToolchains.launcherFor(java.toolchain))
}
tasks.withType(Test) {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}
test {
failFast = true
}
checkstyle {
maxWarnings = 0
toolVersion = '10.7.0'
getConfigDirectory().set(new File(rootDir, 'config/checkstyle'))
}
jacocoTestReport {
executionData(test)
reports {
xml.required = true
csv.required = false
html.required = true
}
}
project.tasks['sonarqube'].dependsOn jacocoTestReport
sonarqube {
properties {
property "sonar.projectName", "Reform :: Civil Commons Library"
property "sonar.projectKey", "uk.gov.hmcts.reform:spring-boot-template"
}
}
// before committing a change, make sure task still works
dependencyUpdates {
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { qualifier -> version.toUpperCase().contains(qualifier) }
def regex = /^[0-9,.v-]+$/
return !stableKeyword && !(version ==~ regex)
}
rejectVersionIf { selection -> // <---- notice how the closure argument is named
return isNonStable(selection.candidate.version) && !isNonStable(selection.currentVersion)
}
}
dependencyManagement {
dependencies {
// Solves CVE-2023-24998
dependency group: 'commons-fileupload', name: 'commons-fileupload', version: '1.5'
}
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2020.0.6'
}
}
// 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 = 0
suppressionFile = 'config/owasp/suppressions.xml'
analyzers {
// Disable scanning of .NET related binaries
assemblyEnabled = false
}
skipConfigurations = [
"checkstyle",
"compileOnly",
]
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
}
maven {
url "https://repo.spring.io/release"
}
maven {
url "https://dl.bintray.com/hmcts/hmcts-maven"
}
}
ext {
log4JVersion = "2.19.0"
}
ext['snakeyaml.version'] = '1.33'
ext.libraries = [
junit5: [
"org.junit.jupiter:junit-jupiter-api:${versions.junit}",
"org.junit.jupiter:junit-jupiter-engine:${versions.junit}",
"org.junit.jupiter:junit-jupiter-params:${versions.junit}",
"org.junit.platform:junit-platform-commons:${versions.junitPlatform}",
"org.junit.platform:junit-platform-engine:${versions.junitPlatform}"
]
]
dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-json'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-cache'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '3.1.6'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-openfeign-core', version: '3.1.6'
implementation group: 'io.github.openfeign', name: 'feign-httpclient', version: '12.3'
implementation group: 'org.springframework.retry', name: 'spring-retry'
implementation group: 'com.sendgrid', name: 'sendgrid-java', version: '4.9.3'
implementation group: 'com.github.hmcts', name: 'ccd-client', version: '4.9.1'
implementation group: 'commons-io', name: 'commons-io', version: '2.11.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'uk.gov.service.notify', name: 'notifications-java-client', version: '3.19.1-RELEASE'
implementation group: 'uk.gov.hmcts.reform', name: 'service-auth-provider-client', version: '4.0.0'
implementation group: 'uk.gov.hmcts.reform', name: 'idam-client', version: '2.0.0'
implementation group: 'uk.gov.hmcts.reform', name: 'send-letter-client', version: '3.0.3'
implementation group: 'uk.gov.hmcts.reform', name: 'document-management-client', version: '7.0.0'
implementation group: 'com.github.hmcts', name: 'ccd-case-document-am-client', version: '1.7.1'
implementation group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: '5.10.7'
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
compileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '4.8.1'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '4.8.1'
testImplementation libraries.junit5
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', {
exclude group: 'junit', module: 'junit'
}
}
bootJar {
enabled = false
}
jar {
enabled = true
}
// Gradle 7.x issue, workaround from: https://github.com/gradle/gradle/issues/17236#issuecomment-894768083
//rootProject.tasks.named("processSmokeTestResources") {
// duplicatesStrategy = 'include'
//}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}