Strip META-INF/maven/** from uber and thin JARs#1408
Strip META-INF/maven/** from uber and thin JARs#1408sreekanth-db wants to merge 3 commits intodatabricks:mainfrom
Conversation
Signed-off-by: Sreekanth Vadigi <[email protected]> Co-authored-by: Isaac Signed-off-by: Sreekanth Vadigi <[email protected]>
Same exclusion as the uber JAR. Arrow is the only shaded dependency in the thin JAR, but its Maven metadata is equally redundant — dependency info is in the published POM on Maven Central. Signed-off-by: Sreekanth Vadigi <[email protected]> Co-authored-by: Isaac Signed-off-by: Sreekanth Vadigi <[email protected]>
| <exclude>META-INF/LICENSE.txt</exclude> | ||
| <exclude>META-INF/versions/**</exclude> | ||
| <exclude>META-INF/maven/**</exclude> | ||
| </excludes> |
There was a problem hiding this comment.
[F1] Thin JAR: useDependencyReducedPomInJar interaction with new exclude (Severity: Medium)
The thin JAR sets useDependencyReducedPomInJar=true at assembly-thin/pom.xml:116-118, which embeds a reduced POM inside the JAR at META-INF/maven/<groupId>/<artifactId>/pom.xml. The new META-INF/maven/** exclude will strip that embedded reduced POM as well.
If any consumer of the thin JAR reads the embedded reduced POM at runtime (rather than fetching the sibling .pom from Maven Central), this silently removes it.
Suggested fix: Either
- Confirm the embedded reduced POM is intentionally stripped (likely fine — most consumers use the Maven Central POM), and call this out in the PR description / changelog, or
- Narrow the exclude to
META-INF/maven/**/pom.propertiesso the reducedpom.xmlremains embedded.
Posted by Code Review Squad.
There was a problem hiding this comment.
Yes, this change is intentional and mentioned in the change log
Signed-off-by: Sreekanth Vadigi <[email protected]> Co-authored-by: Isaac Signed-off-by: Sreekanth Vadigi <[email protected]>
tejassp-db
left a comment
There was a problem hiding this comment.
Are there any uses cases for incuding the pom.xml in the JAR? If not then this looks good. Have we validated the final JAR that is produced does not contain these artifacts anymore?
|
No use cases — these files are Maven build metadata that no code reads at runtime. Dependency info is available in the published POM on Maven Central. Validated locally — uber JAR has 0 META-INF/maven entries, thin JAR has 0 dependency metadata entries (only its own reduced POM remains, which the shade plugin injects post-filter via useDependencyReducedPomInJar). |
|
Re: [F1] - The reduced POM is not affected — the shade plugin injects it post-filter, so the @tejassp-db — |
Summary
META-INF/maven/**(pom.properties,pom.xml) from the shade plugin filter in bothassembly-uberandassembly-thin.Test plan
META-INF/maven/has 0 entriesTestUberPackagingshaded dependency tests passThis pull request was AI-assisted by Isaac.