-
Notifications
You must be signed in to change notification settings - Fork 134
/
build.gradle.kts
271 lines (237 loc) · 10.5 KB
/
build.gradle.kts
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
/*
* Copyright (C) 2022 Dremio
*
* 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.
*/
import io.quarkus.gradle.tasks.QuarkusBuild
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
alias(libs.plugins.quarkus)
id("nessie-conventions-quarkus")
id("nessie-license-report")
}
publishingHelper { mavenName = "Nessie - Quarkus Server" }
val quarkusRunner by
configurations.creating {
description = "Used to reference the generated runner-jar (either fast-jar or uber-jar)"
}
val openapiSource by
configurations.creating { description = "Used to reference OpenAPI spec files" }
val versionIceberg = libs.versions.iceberg.get()
// Need to use :nessie-model-quarkus instead of :nessie-model here, because Quarkus w/
// resteasy-reactive does not work well with multi-release jars, but as long as we support Java 8
// for clients, we have to live with :nessie-model producing an MR-jar. See
// https://github.com/quarkusio/quarkus/issues/40236 and
// https://github.com/projectnessie/nessie/issues/8390.
configurations.all { exclude(group = "org.projectnessie.nessie", module = "nessie-model") }
dependencies {
implementation(project(":nessie-client"))
implementation(project(":nessie-model-quarkus"))
implementation(project(":nessie-services"))
implementation(project(":nessie-services-config"))
implementation(project(":nessie-quarkus-auth"))
implementation(project(":nessie-quarkus-catalog"))
implementation(project(":nessie-quarkus-common"))
implementation(project(":nessie-quarkus-config"))
implementation(project(":nessie-quarkus-distcache"))
implementation(project(":nessie-quarkus-rest"))
implementation(project(":nessie-events-quarkus"))
implementation(project(":nessie-rest-common"))
implementation(project(":nessie-rest-services"))
implementation(project(":nessie-versioned-spi"))
implementation(project(":nessie-notice"))
implementation(project(":nessie-versioned-storage-jdbc"))
implementation(libs.nessie.ui)
implementation(enforcedPlatform(libs.quarkus.bom))
implementation(enforcedPlatform(libs.quarkus.amazon.services.bom))
implementation("io.quarkus:quarkus-resteasy-reactive")
implementation("io.quarkus:quarkus-resteasy-reactive-jackson")
implementation("io.quarkus:quarkus-reactive-routes")
implementation("io.quarkus:quarkus-core-deployment")
implementation("io.quarkus:quarkus-hibernate-validator")
implementation("io.quarkus:quarkus-smallrye-context-propagation")
implementation("io.quarkus:quarkus-smallrye-health")
implementation("io.quarkus:quarkus-smallrye-openapi")
implementation("io.quarkus:quarkus-security")
implementation("io.quarkus:quarkus-elytron-security-properties-file")
implementation("io.quarkus:quarkus-oidc")
implementation("io.quarkus:quarkus-micrometer")
implementation("io.quarkus:quarkus-opentelemetry")
implementation(libs.quarkus.logging.sentry)
implementation("io.smallrye:smallrye-open-api-jaxrs")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation(platform(libs.cel.bom))
implementation("org.projectnessie.cel:cel-standalone")
implementation(libs.guava)
compileOnly(libs.microprofile.openapi)
compileOnly(libs.immutables.value.annotations)
annotationProcessor(libs.immutables.value.processor)
openapiSource(project(":nessie-model-quarkus", "openapiSource"))
testFixturesApi(platform(libs.junit.bom))
testFixturesApi(libs.bundles.junit.testing)
testFixturesApi(project(":nessie-client"))
testFixturesApi(project(":nessie-model-quarkus"))
testFixturesApi(testFixtures(project(":nessie-client")))
testFixturesApi(project(":nessie-client-testextension"))
testFixturesApi(project(":nessie-jaxrs-tests"))
testFixturesApi(project(":nessie-quarkus-auth"))
testFixturesApi(project(":nessie-quarkus-common"))
testFixturesApi(project(":nessie-quarkus-tests"))
testFixturesApi(project(":nessie-catalog-files-api"))
testFixturesApi(project(":nessie-catalog-files-impl"))
testFixturesApi(project(":nessie-events-api"))
testFixturesApi(project(":nessie-events-spi"))
testFixturesApi(project(":nessie-events-service"))
testFixturesImplementation(project(":nessie-versioned-spi"))
testFixturesImplementation(project(":nessie-versioned-tests"))
testFixturesApi(project(":nessie-versioned-storage-common"))
testFixturesApi(project(":nessie-versioned-storage-cache"))
testFixturesApi(project(":nessie-versioned-storage-store"))
testFixturesImplementation(project(":nessie-versioned-storage-testextension")) {
// Needed to avoid dependency resolution error:
// Module 'com.google.guava:guava' ... rejected: 'com.google.guava:listenablefuture:1.0' also
// provided by
// [com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava(compile)]
exclude("com.google.guava")
}
testFixturesApi(enforcedPlatform(libs.quarkus.bom))
testFixturesImplementation("com.fasterxml.jackson.core:jackson-annotations")
testFixturesApi("io.quarkus:quarkus-test-security")
testFixturesApi("io.quarkus:quarkus-test-oidc-server")
testFixturesImplementation(libs.guava)
testFixturesImplementation(libs.microprofile.openapi)
testFixturesImplementation(libs.awaitility)
testFixturesApi(libs.jakarta.validation.api)
testFixturesApi(testFixtures(project(":nessie-quarkus-common")))
testFixturesApi(platform(libs.testcontainers.bom))
testFixturesApi("org.testcontainers:testcontainers")
testFixturesApi(project(":nessie-keycloak-testcontainer"))
testFixturesApi(project(":nessie-azurite-testcontainer"))
testFixturesApi(project(":nessie-gcs-testcontainer"))
testFixturesApi(project(":nessie-minio-testcontainer"))
testFixturesApi(project(":nessie-trino-testcontainer"))
testFixturesApi(project(":nessie-object-storage-mock"))
testFixturesApi(project(":nessie-catalog-format-iceberg"))
testFixturesApi(project(":nessie-catalog-format-iceberg-fixturegen"))
testFixturesApi(platform("org.apache.iceberg:iceberg-bom:$versionIceberg"))
testFixturesApi("org.apache.iceberg:iceberg-core")
testFixturesApi("org.apache.iceberg:iceberg-bundled-guava")
testFixturesApi("org.apache.iceberg:iceberg-aws")
testFixturesApi("org.apache.iceberg:iceberg-gcp")
testFixturesApi("org.apache.iceberg:iceberg-azure")
testFixturesApi("org.apache.iceberg:iceberg-api:$versionIceberg:tests")
testFixturesApi("org.apache.iceberg:iceberg-core:$versionIceberg:tests")
testFixturesApi(libs.hadoop.common) { hadoopExcludes() }
testFixturesCompileOnly(libs.microprofile.openapi)
intTestImplementation("io.quarkus:quarkus-test-keycloak-server")
intTestImplementation(project(":nessie-keycloak-testcontainer"))
intTestImplementation(platform(libs.awssdk.bom))
intTestImplementation("software.amazon.awssdk:s3")
intTestImplementation("software.amazon.awssdk:sts")
}
val openApiSpecDir = layout.buildDirectory.dir("openapi-extra")
val pullOpenApiSpec by
tasks.registering(Sync::class) {
destinationDir = openApiSpecDir.get().asFile
from(openapiSource) { include("openapi.yaml") }
}
quarkus {
quarkusBuildProperties.put("quarkus.package.type", quarkusPackageType())
quarkusBuildProperties.put(
"quarkus.smallrye-openapi.store-schema-directory",
layout.buildDirectory.asFile.map { it.resolve("openapi") }.get().toString()
)
quarkusBuildProperties.put(
"quarkus.smallrye-openapi.additional-docs-directory",
openApiSpecDir.get().toString()
)
quarkusBuildProperties.put("quarkus.smallrye-openapi.info-version", project.version.toString())
quarkusBuildProperties.put("quarkus.smallrye-openapi.auto-add-security", "false")
// Pull manifest attributes from the "main" `jar` task to get the
// release-information into the jars generated by Quarkus.
quarkusBuildProperties.putAll(
provider {
tasks
.named("jar", Jar::class.java)
.get()
.manifest
.attributes
.map { e -> "quarkus.package.manifest.attributes.\"${e.key}\"" to e.value.toString() }
.toMap()
}
)
}
val quarkusAppPartsBuild = tasks.named("quarkusAppPartsBuild")
val quarkusDependenciesBuild = tasks.named("quarkusDependenciesBuild")
val quarkusBuild = tasks.named<QuarkusBuild>("quarkusBuild")
quarkusDependenciesBuild.configure { dependsOn("processJandexIndex") }
quarkusAppPartsBuild.configure {
dependsOn(pullOpenApiSpec)
inputs.files(openapiSource)
}
// Expose runnable jar via quarkusRunner configuration for integration-tests that require the
// server.
artifacts {
add(
quarkusRunner.name,
provider {
if (quarkusFatJar()) quarkusBuild.get().runnerJar
else quarkusBuild.get().fastJar.resolve("quarkus-run.jar")
}
) {
builtBy(quarkusBuild)
}
}
// Add the uber-jar, if built, to the Maven publication
if (quarkusFatJar()) {
afterEvaluate {
publishing {
publications {
named<MavenPublication>("maven") {
artifact(quarkusBuild.get().runnerJar) {
classifier = "runner"
builtBy(quarkusBuild)
}
}
}
}
}
}
listOf("javadoc", "sourcesJar").forEach { name ->
tasks.named(name).configure { dependsOn(tasks.named("compileQuarkusGeneratedSourcesJava")) }
}
listOf("checkstyleTest", "compileTestJava").forEach { name ->
tasks.named(name).configure { dependsOn(tasks.named("compileQuarkusTestGeneratedSourcesJava")) }
}
// Testcontainers is not supported on Windows :(
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
tasks.named<Test>("intTest").configure { this.enabled = false }
}
// Issue w/ testcontainers/podman in GH workflows :(
if (Os.isFamily(Os.FAMILY_MAC) && System.getenv("CI") != null) {
tasks.named<Test>("intTest").configure { this.enabled = false }
}
fun ModuleDependency.hadoopExcludes() {
exclude("ch.qos.reload4j", "reload4j")
exclude("com.sun.jersey")
exclude("commons-cli", "commons-cli")
exclude("jakarta.activation", "jakarta.activation-api")
exclude("javax.servlet", "javax.servlet-api")
exclude("javax.servlet.jsp", "jsp-api")
exclude("javax.ws.rs", "javax.ws.rs-api")
exclude("log4j", "log4j")
exclude("org.slf4j", "slf4j-log4j12")
exclude("org.slf4j", "slf4j-reload4j")
exclude("org.eclipse.jetty")
exclude("org.apache.zookeeper")
}