Skip to content
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

Merged
merged 1 commit into from Oct 31, 2018

Conversation

lukecwik
Copy link
Member

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:

  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

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)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
Build Status --- --- ---

@lukecwik
Copy link
Member Author

R: @iemejia

@iemejia
Copy link
Member

iemejia commented Oct 30, 2018

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
Copy link
Member

@iemejia iemejia Oct 31, 2018

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?

Copy link
Member Author

@lukecwik lukecwik Oct 31, 2018

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.

Copy link
Member Author

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.

Copy link
Member Author

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
Copy link
Member

@iemejia iemejia left a comment

Choose a reason for hiding this comment

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

LGTM

@iemejia iemejia merged commit 6ecf5f6 into apache:master Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants