Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Relocate guava classes with maven shade plugin #850

Merged
merged 2 commits into from
Aug 7, 2017

Conversation

davidxia
Copy link
Contributor

to avoid class conflicts with other guava versions.

Fixes #826

to avoid class conflicts with other guava versions.

Fixes #826
@codecov-io
Copy link

codecov-io commented Jul 29, 2017

Codecov Report

Merging #850 into master will increase coverage by 0.08%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master     #850      +/-   ##
============================================
+ Coverage     66.37%   66.46%   +0.08%     
- Complexity      743      745       +2     
============================================
  Files           166      166              
  Lines          3138     3140       +2     
  Branches        357      357              
============================================
+ Hits           2083     2087       +4     
  Misses          898      898              
+ Partials        157      155       -2

@davidxia davidxia requested a review from mattnworb August 4, 2017 18:11
@davidxia
Copy link
Contributor Author

davidxia commented Aug 4, 2017

@mattnworb What do you think?

Copy link
Member

@mattnworb mattnworb left a comment

Choose a reason for hiding this comment

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

update Changelog too please

pom.xml Outdated
@@ -338,6 +339,10 @@
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>com.spotify.docker.client.shaded.com.fasterxml.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.guava</pattern>
Copy link
Member

Choose a reason for hiding this comment

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

pom.xml Outdated
@@ -338,6 +339,10 @@
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>com.spotify.docker.client.shaded.com.fasterxml.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.guava</pattern>
<shadedPattern>com.spotify.docker.client.shaded.com.google.guava</shadedPattern>
Copy link
Member

Choose a reason for hiding this comment

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

same update needed on this line

@@ -319,6 +319,7 @@
<include>org.glassfish.**</include>
<include>com.github.jnr:*</include>
<include>org.ow2.asm:*</include>
<include>com.google.guava:**</include>
Copy link
Member

@mattnworb mattnworb Aug 5, 2017

Choose a reason for hiding this comment

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

I believe this will include the original Guava classes as-is in the shaded jar.

I tested it out and:

dxia/relocate-guava!docker-client $> unzip -l target/docker-client-8.8.3-SNAPSHOT-shaded.jar | grep GwtCompatible
      640  08-05-2017 12:48   com/google/common/annotations/GwtCompatible.class

so I think this line should be removed (although maybe this behavior changes if the relocation/pattern below is corrected? note there is no relocated class present in this output)

@mattnworb mattnworb assigned caipre and davidxia and unassigned caipre and davidxia Aug 7, 2017
@mattnworb mattnworb merged commit 67d8d0e into master Aug 7, 2017
@mattnworb mattnworb deleted the dxia/relocate-guava branch August 7, 2017 20:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants