You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by jb...@apache.org on 2026/07/04 05:18:19 UTC
(polaris) branch main updated: fix(build): restore task dependency for Spark bundle jar Maven publication (#4876)
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 1e2d97c908 fix(build): restore task dependency for Spark bundle jar Maven publication (#4876)
1e2d97c908 is described below
commit 1e2d97c908228c6d0e4c25f16cbef30c5d883a12
Author: Adnan Hemani <ad...@berkeley.edu>
AuthorDate: Fri Jul 3 22:18:16 2026 -0700
fix(build): restore task dependency for Spark bundle jar Maven publication (#4876)
* Fix Spark bundle JAR missing from Maven publication
Move artifact registration for createPolarisSparkJar out of
PublishingHelperPlugin and into each Spark module build script,
using a TaskProvider<ShadowJar> variable to properly wire the task
dependency into the Maven publication.
* Apply spotless formatting to Spark build scripts
---
.../kotlin/publishing/PublishingHelperPlugin.kt | 7 --
plugins/spark/v3.5/spark/build.gradle.kts | 95 ++++++++++++----------
plugins/spark/v4.0/spark/build.gradle.kts | 95 ++++++++++++----------
3 files changed, 102 insertions(+), 95 deletions(-)
diff --git a/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt b/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
index 59d5bfcf8a..03616c9457 100644
--- a/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
+++ b/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
@@ -136,13 +136,6 @@ constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Pl
suppressPomMetadataWarningsFor("testFixturesApiElements")
suppressPomMetadataWarningsFor("testFixturesRuntimeElements")
- project.tasks
- .matching { task -> task.name == "createPolarisSparkJar" }
- .configureEach {
- // if the project contains spark client jar, also publish the jar to maven
- artifact(this)
- }
-
if (project.isSigningEnabled()) {
configure<SigningExtension> { sign(mavenPublication) }
}
diff --git a/plugins/spark/v3.5/spark/build.gradle.kts b/plugins/spark/v3.5/spark/build.gradle.kts
index fe035fcd40..09887e4104 100644
--- a/plugins/spark/v3.5/spark/build.gradle.kts
+++ b/plugins/spark/v3.5/spark/build.gradle.kts
@@ -207,52 +207,59 @@ listOf("intTestCompileClasspath", "intTestRuntimeClasspath").forEach {
}
}
-tasks.register<ShadowJar>("createPolarisSparkJar") {
- archiveClassifier = "bundle"
- isZip64 = true
-
- // pack both the source code and dependencies
- from(sourceSets.main.map { it.output })
- configurations = provider { listOf(project.configurations.runtimeClasspath.get()) }
-
- // Includes _all_ duplicates (this is applied files processed by `ShadowJar`).
- duplicatesStrategy = DuplicatesStrategy.INCLUDE
- // This setting applies to the _result_ of the `ShadowJar`.
- failOnDuplicateEntries = true
-
- // Generally, preserve META-INF/maven/*/*/pom.* files for downstream tools that
- // can analyze dependency jars.
- //
- // There are quite a few _duplicated_ occurrences of failureaccess, guava,
- // listenablefuture, error_prone_annotations, j2objc-annotations, gson.
- // Leave those here so that dependency analyzing tools can pick those up.
-
- exclude(
- // Recursively remove all LICENSE and NOTICE file under META-INF, includes
- // directories contains 'license' in the name.
- "META-INF/**/*LICENSE*",
- "META-INF/**/*NOTICE*",
- // exclude the top level LICENSE, LICENSE-*.txt and NOTICE
- "LICENSE*",
- "NOTICE*",
-
- // Exclude Jandex indexes
- "META-INF/jandex.idx",
-
- // From Hive/Hadoop - exclude those to not confuse people.
- "META-INF/DEPENDENCIES",
- )
+val createPolarisSparkJar =
+ tasks.register<ShadowJar>("createPolarisSparkJar") {
+ archiveClassifier = "bundle"
+ isZip64 = true
+
+ // pack both the source code and dependencies
+ from(sourceSets.main.map { it.output })
+ configurations = provider { listOf(project.configurations.runtimeClasspath.get()) }
+
+ // Includes _all_ duplicates (this is applied files processed by `ShadowJar`).
+ duplicatesStrategy = DuplicatesStrategy.INCLUDE
+ // This setting applies to the _result_ of the `ShadowJar`.
+ failOnDuplicateEntries = true
+
+ // Generally, preserve META-INF/maven/*/*/pom.* files for downstream tools that
+ // can analyze dependency jars.
+ //
+ // There are quite a few _duplicated_ occurrences of failureaccess, guava,
+ // listenablefuture, error_prone_annotations, j2objc-annotations, gson.
+ // Leave those here so that dependency analyzing tools can pick those up.
+
+ exclude(
+ // Recursively remove all LICENSE and NOTICE file under META-INF, includes
+ // directories contains 'license' in the name.
+ "META-INF/**/*LICENSE*",
+ "META-INF/**/*NOTICE*",
+ // exclude the top level LICENSE, LICENSE-*.txt and NOTICE
+ "LICENSE*",
+ "NOTICE*",
+
+ // Exclude Jandex indexes
+ "META-INF/jandex.idx",
+
+ // From Hive/Hadoop - exclude those to not confuse people.
+ "META-INF/DEPENDENCIES",
+ )
- // add polaris customized LICENSE and NOTICE for the bundle jar at top level. Note that the
- // customized LICENSE and NOTICE file are called BUNDLE-LICENSE and BUNDLE-NOTICE,
- // and renamed to LICENSE and NOTICE after include, this is to avoid the file
- // being excluded due to the exclude pattern matching used above.
- from("${projectDir}/BUNDLE-LICENSE") { rename { "LICENSE" } }
- from("${projectDir}/BUNDLE-NOTICE") { rename { "NOTICE" } }
-}
+ // add polaris customized LICENSE and NOTICE for the bundle jar at top level. Note that the
+ // customized LICENSE and NOTICE file are called BUNDLE-LICENSE and BUNDLE-NOTICE,
+ // and renamed to LICENSE and NOTICE after include, this is to avoid the file
+ // being excluded due to the exclude pattern matching used above.
+ from("${projectDir}/BUNDLE-LICENSE") { rename { "LICENSE" } }
+ from("${projectDir}/BUNDLE-NOTICE") { rename { "NOTICE" } }
+ }
// ensure the shadow jar job (which will automatically run license addition) is run for both
// `assemble` and `build` task
-tasks.named("assemble") { dependsOn("createPolarisSparkJar") }
+tasks.named("assemble") { dependsOn(createPolarisSparkJar) }
-tasks.named("build") { dependsOn("createPolarisSparkJar") }
+tasks.named("build") { dependsOn(createPolarisSparkJar) }
+
+publishing {
+ publications.named<MavenPublication>("maven") {
+ artifact(createPolarisSparkJar)
+ }
+}
diff --git a/plugins/spark/v4.0/spark/build.gradle.kts b/plugins/spark/v4.0/spark/build.gradle.kts
index b4576a5913..f569dabdaf 100644
--- a/plugins/spark/v4.0/spark/build.gradle.kts
+++ b/plugins/spark/v4.0/spark/build.gradle.kts
@@ -210,52 +210,59 @@ configurations.named("intTestRuntimeClasspath") {
resolutionStrategy { force("jakarta.servlet:jakarta.servlet-api:5.0.0") }
}
-tasks.register<ShadowJar>("createPolarisSparkJar") {
- archiveClassifier = "bundle"
- isZip64 = true
-
- // pack both the source code and dependencies
- from(sourceSets.main.map { it.output })
- configurations = provider { listOf(project.configurations.runtimeClasspath.get()) }
-
- // Includes _all_ duplicates (this is applied files processed by `ShadowJar`).
- duplicatesStrategy = DuplicatesStrategy.INCLUDE
- // This setting applies to the _result_ of the `ShadowJar`.
- failOnDuplicateEntries = true
-
- // Generally, preserve META-INF/maven/*/*/pom.* files for downstream tools that
- // can analyze dependency jars.
- //
- // There are quite a few _duplicated_ occurrences of failureaccess, guava,
- // listenablefuture, error_prone_annotations, j2objc-annotations, gson.
- // Leave those here so that dependency analyzing tools can pick those up.
-
- exclude(
- // Recursively remove all LICENSE and NOTICE file under META-INF, includes
- // directories contains 'license' in the name.
- "META-INF/**/*LICENSE*",
- "META-INF/**/*NOTICE*",
- // exclude the top level LICENSE, LICENSE-*.txt and NOTICE
- "LICENSE*",
- "NOTICE*",
-
- // Exclude Jandex indexes
- "META-INF/jandex.idx",
-
- // From Hive/Hadoop - exclude those to not confuse people.
- "META-INF/DEPENDENCIES",
- )
+val createPolarisSparkJar =
+ tasks.register<ShadowJar>("createPolarisSparkJar") {
+ archiveClassifier = "bundle"
+ isZip64 = true
+
+ // pack both the source code and dependencies
+ from(sourceSets.main.map { it.output })
+ configurations = provider { listOf(project.configurations.runtimeClasspath.get()) }
+
+ // Includes _all_ duplicates (this is applied files processed by `ShadowJar`).
+ duplicatesStrategy = DuplicatesStrategy.INCLUDE
+ // This setting applies to the _result_ of the `ShadowJar`.
+ failOnDuplicateEntries = true
+
+ // Generally, preserve META-INF/maven/*/*/pom.* files for downstream tools that
+ // can analyze dependency jars.
+ //
+ // There are quite a few _duplicated_ occurrences of failureaccess, guava,
+ // listenablefuture, error_prone_annotations, j2objc-annotations, gson.
+ // Leave those here so that dependency analyzing tools can pick those up.
+
+ exclude(
+ // Recursively remove all LICENSE and NOTICE file under META-INF, includes
+ // directories contains 'license' in the name.
+ "META-INF/**/*LICENSE*",
+ "META-INF/**/*NOTICE*",
+ // exclude the top level LICENSE, LICENSE-*.txt and NOTICE
+ "LICENSE*",
+ "NOTICE*",
+
+ // Exclude Jandex indexes
+ "META-INF/jandex.idx",
+
+ // From Hive/Hadoop - exclude those to not confuse people.
+ "META-INF/DEPENDENCIES",
+ )
- // add polaris customized LICENSE and NOTICE for the bundle jar at top level. Note that the
- // customized LICENSE and NOTICE file are called BUNDLE-LICENSE and BUNDLE-NOTICE,
- // and renamed to LICENSE and NOTICE after include, this is to avoid the file
- // being excluded due to the exclude pattern matching used above.
- from("${projectDir}/BUNDLE-LICENSE") { rename { "LICENSE" } }
- from("${projectDir}/BUNDLE-NOTICE") { rename { "NOTICE" } }
-}
+ // add polaris customized LICENSE and NOTICE for the bundle jar at top level. Note that the
+ // customized LICENSE and NOTICE file are called BUNDLE-LICENSE and BUNDLE-NOTICE,
+ // and renamed to LICENSE and NOTICE after include, this is to avoid the file
+ // being excluded due to the exclude pattern matching used above.
+ from("${projectDir}/BUNDLE-LICENSE") { rename { "LICENSE" } }
+ from("${projectDir}/BUNDLE-NOTICE") { rename { "NOTICE" } }
+ }
// ensure the shadow jar job (which will automatically run license addition) is run for both
// `assemble` and `build` task
-tasks.named("assemble") { dependsOn("createPolarisSparkJar") }
+tasks.named("assemble") { dependsOn(createPolarisSparkJar) }
-tasks.named("build") { dependsOn("createPolarisSparkJar") }
+tasks.named("build") { dependsOn(createPolarisSparkJar) }
+
+publishing {
+ publications.named<MavenPublication>("maven") {
+ artifact(createPolarisSparkJar)
+ }
+}