Skip to content

Exclude third-party META-INF/maven descriptors... - #41659

Open
chamikaramj wants to merge 1 commit into
apache:masterfrom
chamikaramj:vendor-exclude-maven-descriptors
Open

chamikaramj wants to merge 1 commit into
apache:masterfrom
chamikaramj:vendor-exclude-maven-descriptors

Conversation

@chamikaramj

Copy link
Copy Markdown
Contributor

...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.

@github-actions github-actions Bot added build vendor size/s S: 10-49 lines changed labels Nov 25, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 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/**" on shadowJar is properly scoped to the main copy spec, allowing the child into("META-INF/maven/${project.group}/${project.name}") specs configured under vendoredDependenciesOnly to still include Beam's generated Maven descriptors.
  • There is a pre-existing mismatch in how the artifact directory path is constructed (project.name vs config.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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @derrickaw for label build.
Backup reviewer: damccorm (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant