-
Notifications
You must be signed in to change notification settings - Fork 549
Relocate guava classes with maven shade plugin #850
Conversation
to avoid class conflicts with other guava versions. Fixes #826
Codecov Report
@@ 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 |
@mattnworb What do you think? |
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.
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> |
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 think this should be com.google.common
see https://github.com/google/guava/tree/master/guava/src/com/google
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> |
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.
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> |
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 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)
to avoid class conflicts with other guava versions.
Fixes #826