Repository navigation
Exclude third-party META-INF/maven descriptors... - #41659
chamikaramj wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR generalizes the exclusion of third-party META-INF/maven/** descriptors across all vendored Java dependencies in VendorJavaPlugin and removes the now-redundant exclusion from vendor/calcite-1_40_0/build.gradle. It also extends validateVendoring to verify that third-party Maven descriptors do not leak into the shaded JAR while ensuring that Beam's own generated pom.xml and pom.properties are preserved when vendoredDependenciesOnly is set.
🔍 General Feedback
- The global
exclude "META-INF/maven/**"onshadowJaris properly scoped to the main copy spec, allowing the childinto("META-INF/maven/${project.group}/${project.name}")specs configured undervendoredDependenciesOnlyto still include Beam's generated Maven descriptors. - There is a pre-existing mismatch in how the artifact directory path is constructed (
project.namevsconfig.artifactId) which affects both the generated descriptor path and the new validation check.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
| throw new GradleException("$it leaked third-party Maven descriptors: ${leakedMavenMetadata.files}") | ||
| } | ||
| if (project.hasProperty("vendoredDependenciesOnly")) { | ||
| Set<String> ownMavenFiles = project.zipTree(it).matching { |
There was a problem hiding this comment.
🟢 Nit / Minor: VendorJavaPlugin configures the Maven publication with groupId = config.groupId and artifactId = config.artifactId, whereas project.name is the Gradle subproject directory name (for example, calcite-1_40_0 instead of beam-vendor-calcite-1_40_0). While this matches the existing into("META-INF/maven/${project.group}/${project.name}") copy specs below, standard Maven archiver conventions place descriptors under META-INF/maven/<groupId>/<artifactId>/. Consider aligning the pom.properties generation, shadowJar into(...) paths, and these validation checks to use ${config.groupId}/${config.artifactId} (or ${project.group}/${project.archivesBaseName}), or extracting the target path into a shared variable to avoid duplication.
|
Assigning reviewers: R: @derrickaw for label build. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
...in VendorJavaPlugin.
Retains metadata files added by Beam.
Added checks to verify.
We were already doing this for vendored Calcite, this generalizes this for all vendored dependencies.