New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BEAM-5919] Exclude META-INF from validation of shaded jar files #6889
Conversation
R: @iemejia |
Run Java PreCommit |
@@ -802,6 +802,7 @@ class BeamModulePlugin implements Plugin<Project> { | |||
project.configurations.shadow.artifacts.files.each { | |||
FileTree exposedClasses = project.zipTree(it).matching { | |||
include "**/*.class" | |||
exclude "META-INF/**" // BEAM-5919: Exclude module-info.class for Java 9 build support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if to be future proof we do better add here META-INF/versions/**/module-info.class
and META-INF/versions/**/org/apache/beam/**
I am assuming this after reading:
https://blog.codefx.org/tools/multi-release-jars-multiple-java-versions/
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. Thanks for the pointer and valuable new knowledge about how Java 9 is going to support multiple code versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it will be a long while before "shading" tools support multi-release jars and can see the amount of confusion/bugs people attempting to shade these will cause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to use a single *
for the version directory instead of **
.
Since **
matches any number of directories as per:
https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/util/PatternFilterable.html
The rule used to match a "class" file added by Java 9 that is put underneath META-INF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The rule used to match a "class" file added by Java 9 that is put underneath META-INF
Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.It will help us expedite review of your Pull Request if you tag someone (e.g.
@username
) to look at it.Post-Commit Tests Status (on master branch)