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

fix: make google-http-client.properties file shading friendly #1046

Merged
merged 1 commit into from Oct 13, 2020
Merged

fix: make google-http-client.properties file shading friendly #1046

merged 1 commit into from Oct 13, 2020

Conversation

medb
Copy link
Contributor

@medb medb commented May 21, 2020

Fixes an issue when there are 2 versions of this library in a class path - 1) shaded/relocated library of x.x.x version inside a "jar-with-dependencies" and 2) non-shaded library of y.y.y version.

Because both of these libraries will load non-shaded google-http-client.properties file they will use the same y.y.y version even though shaded library has a x.x.x version.

@medb medb requested a review from as a code owner May 21, 2020
@googlebot googlebot added the cla: yes label May 21, 2020
@chingor13 chingor13 changed the title Make google-http-client.properties file shading friendly fix: make google-http-client.properties file shading friendly Jun 19, 2020
@BenWhitehead
Copy link
Contributor

@BenWhitehead BenWhitehead commented Jun 19, 2020

@medb Can you describe why this change is needed? The properties file should be able to be loaded from an uber-jar or other shaded jar just fine without modification.

I have a local project on my machine I used to execute a few commands against Firestore (which is a downstream consumer of this library). This project is packaged as a "jar-with-dependencies" file. HttpRequest is able to load the properties files successfully as-is.

❱ java -jar target/cleanup-0.1.1-SNAPSHOT-jar-with-dependencies.jar 
HttpRequest.VERSION = 1.34.2

From this code

public static void main(String[] args) {
  System.out.println("HttpRequest.VERSION = " + com.google.api.client.http.HttpRequest.VERSION);
}

@medb
Copy link
Contributor Author

@medb medb commented Jun 20, 2020

@BenWhitehead The issue is that if there are 2 versions of this library in a class path - 1) shaded/relocated library of x.x.x version inside a "jar-with-dependencies" and 2) non-shaded library of y.y.y version.

Because both of these libraries will load non-shaded google-http-client.properties they will use the same y.y.y version even though shaded library has a x.x.x version.

@BenWhitehead
Copy link
Contributor

@BenWhitehead BenWhitehead commented Jul 7, 2020

@chingor13 What are you thoughts here on moving the properties file? We might need to move it for the couple other libraries we introduced this same pattern in.

@chingor13 chingor13 added the kokoro:force-run label Oct 13, 2020
@kokoro-team kokoro-team removed the kokoro:force-run label Oct 13, 2020
@chingor13 chingor13 merged commit 860bb05 into googleapis:master Oct 13, 2020
18 checks passed
@medb medb deleted the patch-2 branch Oct 13, 2020
gcf-merge-on-green bot pushed a commit that referenced this issue Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants