-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathbuild.gradle
More file actions
274 lines (237 loc) · 8.31 KB
/
Copy pathbuild.gradle
File metadata and controls
274 lines (237 loc) · 8.31 KB
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
/*
* Copyright 2019 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
alias(libs.plugins.java.library)
alias(libs.plugins.owasp.dependencycheck)
alias(libs.plugins.drill.integration)
alias(libs.plugins.openapi.generator)
alias(libs.plugins.spring.boot)
alias(libs.plugins.jooq.codegen)
}
import org.owasp.dependencycheck.reporting.ReportGenerator
apply from: 'project-properties.gradle'
apply from: "$scriptsUrl/build-commons.gradle"
apply from: "$scriptsUrl/build-info.gradle"
apply from: "$scriptsUrl/release-service.gradle"
apply from: "$scriptsUrl/signing.gradle"
apply from: "$scriptsUrl/copy-database-scripts.gradle"
project.hasProperty('sealightsSession') && sealightsSession?.trim() ?
apply(from: 'sealights.gradle') :
println('No sealights session')
java {
targetCompatibility = JavaVersion.VERSION_25
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
println("Release mode: $releaseMode")
dependencies {
implementation(platform(libs.zonky.postgres.bom))
api(libs.embedded.postgres)
api(platform(libs.spring.boot.bom))
// Spring Modulith
implementation(platform(libs.spring.modulith.bom))
implementation(libs.spring.modulith.starter.core)
implementation(libs.spring.modulith.events.api)
implementation(libs.spring.modulith.actuator)
testImplementation(libs.spring.modulith.docs)
testImplementation(libs.spring.modulith.starter.test)
testImplementation(libs.spring.modulith.junit)
api(libs.jclouds.s3)
api(libs.jclouds.aw.s3)
api(libs.jclouds.filesystem)
api(libs.guava)
api(libs.jasypt)
api(libs.pf4j)
api(libs.jackson.databind)
api(libs.jackson.jsr310)
api(libs.jooq)
api(libs.apache.commons.collections4)
api(libs.tika)
api(libs.httpclient5) // supports gzip encoding
api(libs.spring.context)
api(libs.spring.jdbc)
api(libs.spring.web)
api(libs.spring.data.jpa)
api(libs.spring.security.core)
implementation(libs.spring.security.ldap)
implementation(libs.spring.security.saml2.service.provider)
implementation(libs.spring.security.oauth2.authorization.server)
runtimeOnly(libs.nimbus.oauth2.oidc.sdk)
api(libs.spring.data.commons)
api(libs.hibernate.core)
api(libs.jakarta.validation)
api(libs.pf4j.update) // TODO get rid of and rewrite with the latest version of pf4j
implementation(libs.bundles.spring.boot.starters)
implementation(libs.bundles.spring.security)
// MultipartFileUtils requires org.springframework.mock.web.MockMultipartFile
// TODO: implement own MultipartFile class
implementation(libs.spring.test)
implementation(libs.springdoc.openapi)
implementation(libs.micrometer)
implementation(libs.kotlin.stdlib)
implementation(libs.opencsv)
implementation(libs.slugify)
implementation(libs.postgresql)
jooqCodegen(libs.postgresql)
implementation(libs.thumbnailator)
implementation(libs.aws.core)
implementation(libs.aws.sts)
implementation(libs.jakarta.xml.bind.api)
implementation(libs.jaxb.api)
implementation(libs.json) // TODO get rid of
implementation(libs.flyway.core) // TODO get rid of
implementation(libs.flyway.database.postgresql) // TODO get rid of
// Optional for spring-boot-starter-amqp
implementation(libs.rabbitmq.http.client)
// Check authentication error response format for versions higher than 6.21.3 TODO: consider upgrade to 7.0.1+
implementation(libs.jasperreports) {
exclude group: 'com.fasterxml.jackson.dataformat', module: 'jackson-dataformat-xml'
}
// JasperReport's export to XLS uses Apache POI and openpdf for PDF export
implementation(libs.apache.poi)
implementation(libs.apache.poi.ooxml)
implementation(libs.apache.commons.commonscsv)
implementation(libs.openpdf)
implementation(libs.jakarta.inject.api)
implementation(libs.jakarta.mail)
implementation(libs.xerces)
implementation(libs.bouncycastle)
implementation(libs.google.api.client)
implementation(libs.commons.validator) {
exclude group: 'commons-beanutils', module: 'commons-beanutils'
}
implementation(libs.caffeine)
implementation(libs.apache.commons.compress)
implementation(libs.apache.commons.lang3)
implementation(libs.hibernate.validator)
implementation(libs.json.schema.validator)
// Add lombok support
compileOnly(libs.lombok)
annotationProcessor(libs.lombok)
//mapstruct
implementation(libs.mapstruct)
annotationProcessor(libs.mapstruct.processor)
// Tests
testImplementation(libs.bundles.test.libs)
testCompileOnly(libs.lombok)
testAnnotationProcessor(libs.lombok)
}
sourceSets {
main {
java {
srcDirs "$buildDir/generated/src/main/java"
}
}
}
openApiGenerate {
generatorName.set("spring")
inputSpec.set("$rootDir/api-registry/api/openapi/reportportal-api.yaml")
outputDir.set("${layout.buildDirectory.get()}/generated")
configFile.set("$rootDir/src/main/resources/openapi/config.json")
skipOverwrite.set(false)
cleanupOutput.set(true)
// verbose.set(true)
}
processResources {
dependsOn(gitInfo)
filesMatching('application.properties') {
expand(project.properties)
}
}
tasks.register('updateApiSubmodule', Exec) {
commandLine 'git', 'submodule', 'update', '--init', "--recursive"
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
options.encoding = "UTF-8"
options.compilerArgs << "-parameters"
options.debug = true
options.debugOptions.debugLevel = "source,lines,vars"
}
tasks.register('downloadManifestSchema') {
doLast {
def schemaDir = file("${projectDir}/src/main/resources/schema")
schemaDir.mkdirs()
def schemaUrl = new URI(manifestSchemaUrl).toURL()
def fileName = schemaUrl.path.tokenize('/').last()
def schemaFile = new File(schemaDir, fileName)
schemaFile.withOutputStream { out ->
out << schemaUrl.openStream()
}
}
}
dependencyCheck {
formats = [ReportGenerator.Format.HTML, ReportGenerator.Format.XML] as List<String>
// cveValidForHours = 1
}
bootJar {
duplicatesStrategy = duplicatesStrategy.EXCLUDE
project.hasProperty('gcp') ? getArchiveFileName().set('app.jar') : archiveClassifier.set('' + 'exec')
}
jar.enabled = true
jar.archiveClassifier.set('')
test {
dependsOn(copyTestDatabaseScripts)
useJUnitPlatform()
maxParallelForks = 1
testLogging {
events = ['failed']
exceptionFormat = 'short'
}
reports {
junitXml.required = true
}
maxHeapSize = '2g'
}
compileJava.dependsOn tasks.named('openApiGenerate')
compileJava.dependsOn tasks.named('downloadManifestSchema')
publish.dependsOn build
publish.mustRunAfter build
checkCommitNeeded.dependsOn removeScripts
//replaced with drill4j
//build.dependsOn jacocoTestReport
drill {
groupId = "report-portal"
appId = "service-api"
packagePrefixes = ["com/epam/reportportal"]
enableTestAgent {
enabled = System.getenv("DRILL_AGENT_ENABLED") == "true" ?: false
version = "0.23.5"
}
enableAppAgent {
enabled = System.getenv("DRILL_AGENT_ENABLED") == "true" ?: false
version = "0.9.7"
}
}
springBoot {
buildInfo {
properties {
name = "API Service"
version = "${project.version}"
additional = [
"description": "$project.description",
"branch" : getCurrentGitBranch(),
"repo" : "reportportal/service-api"
]
excludes = ['time', 'artifact']
}
}
}
tasks.preTagCommit.enabled = false
tasks.updateVersion.enabled = false
tasks.commitNewVersion.enabled = false