Skip to content

Commit 2ffd3b0

Browse files
authored
open-api: Build runtime jar for test fixture (#11279)
1 parent 9be7f00 commit 2ffd3b0

File tree

4 files changed

+807
-3
lines changed

4 files changed

+807
-3
lines changed

build.gradle

+25-3
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,9 @@ project(':iceberg-snowflake') {
947947

948948
project(':iceberg-open-api') {
949949
apply plugin: 'java-test-fixtures'
950+
apply plugin: 'com.gradleup.shadow'
951+
952+
build.dependsOn shadowJar
950953

951954
dependencies {
952955
testImplementation project(':iceberg-api')
@@ -970,11 +973,9 @@ project(':iceberg-open-api') {
970973
testFixturesImplementation project(':iceberg-gcp')
971974
testFixturesImplementation project(':iceberg-azure')
972975
testFixturesImplementation(libs.hadoop3.common) {
973-
exclude group: 'log4j'
974976
exclude group: 'org.slf4j'
975977
exclude group: 'ch.qos.reload4j'
976978
exclude group: 'org.apache.avro', module: 'avro'
977-
exclude group: 'com.fasterxml.woodstox'
978979
exclude group: 'com.google.guava'
979980
exclude group: 'com.google.protobuf'
980981
exclude group: 'org.apache.curator'
@@ -983,7 +984,6 @@ project(':iceberg-open-api') {
983984
exclude group: 'org.apache.hadoop', module: 'hadoop-auth'
984985
exclude group: 'org.apache.commons', module: 'commons-configuration2'
985986
exclude group: 'org.apache.hadoop.thirdparty', module: 'hadoop-shaded-protobuf_3_7'
986-
exclude group: 'org.codehaus.woodstox'
987987
exclude group: 'org.eclipse.jetty'
988988
}
989989
testFixturesImplementation project(path: ':iceberg-bundled-guava', configuration: 'shadow')
@@ -1017,6 +1017,28 @@ project(':iceberg-open-api') {
10171017
recommend.set(true)
10181018
}
10191019
check.dependsOn('validateRESTCatalogSpec')
1020+
1021+
shadowJar {
1022+
archiveBaseName.set("iceberg-open-api-test-fixtures-runtime")
1023+
archiveClassifier.set(null)
1024+
configurations = [project.configurations.testFixturesRuntimeClasspath]
1025+
from sourceSets.testFixtures.output
1026+
zip64 true
1027+
1028+
// include the LICENSE and NOTICE files for the runtime Jar
1029+
from(projectDir) {
1030+
include 'LICENSE'
1031+
include 'NOTICE'
1032+
}
1033+
1034+
manifest {
1035+
attributes 'Main-Class': 'org.apache.iceberg.rest.RESTCatalogServer'
1036+
}
1037+
}
1038+
1039+
jar {
1040+
enabled = false
1041+
}
10201042
}
10211043

10221044
@Memoized

deploy.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ subprojects {
7575
} else if (isOpenApi) {
7676
artifact testJar
7777
artifact testFixturesJar
78+
artifact shadowJar
7879
} else {
7980
if (tasks.matching({task -> task.name == 'shadowJar'}).isEmpty()) {
8081
from components.java

0 commit comments

Comments
 (0)