Skip to content

Commit 16e5aac

Browse files
authored
Shade grpc (#1799)
Signed-off-by: yhmo <yihua.mo@zilliz.com>
1 parent 64c8e78 commit 16e5aac

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ target/
3131
volumes/
3232
*.iml
3333
.flattened-pom.xml
34+
dependency-reduced-pom.xml
35+
META-INF/
3436

3537
# Example files
3638
examples/bulk_writer

sdk-core/pom.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
<plugin>
178178
<groupId>org.apache.maven.plugins</groupId>
179179
<artifactId>maven-jar-plugin</artifactId>
180+
<version>3.5.0</version>
180181
<configuration>
181182
<archive>
182183
<manifest>
@@ -185,6 +186,61 @@
185186
</archive>
186187
</configuration>
187188
</plugin>
189+
<plugin>
190+
<groupId>org.apache.maven.plugins</groupId>
191+
<artifactId>maven-shade-plugin</artifactId>
192+
<version>3.6.0</version>
193+
<executions>
194+
<execution>
195+
<phase>package</phase>
196+
<goals>
197+
<goal>shade</goal>
198+
</goals>
199+
<configuration>
200+
<createDependencyReducedPom>true</createDependencyReducedPom>
201+
<dependencyReducedPomLocation>${project.basedir}/.flattened-pom.xml</dependencyReducedPomLocation>
202+
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
203+
<artifactSet>
204+
<includes>
205+
<include>io.grpc:*</include>
206+
</includes>
207+
</artifactSet>
208+
<filters>
209+
<filter>
210+
<artifact>*:*</artifact>
211+
<excludes>
212+
<exclude>META-INF/*.SF</exclude>
213+
<exclude>META-INF/*.DSA</exclude>
214+
<exclude>META-INF/*.RSA</exclude>
215+
<exclude>META-INF/MANIFEST.MF</exclude>
216+
<exclude>module-info.class</exclude>
217+
</excludes>
218+
</filter>
219+
</filters>
220+
<relocations>
221+
<relocation>
222+
<pattern>io.grpc</pattern>
223+
<shadedPattern>io.milvus.shaded.io.grpc</shadedPattern>
224+
<excludes>
225+
<exclude>io.grpc.netty.shaded.io.grpc.netty.*</exclude>
226+
</excludes>
227+
</relocation>
228+
<relocation>
229+
<pattern>io.grpc.netty.shaded.io.grpc.netty</pattern>
230+
<shadedPattern>io.milvus.shaded.io.grpc.netty.shaded.io.grpc.netty</shadedPattern>
231+
<includes>
232+
<include>io.grpc.netty.shaded.io.grpc.netty.*</include>
233+
</includes>
234+
</relocation>
235+
</relocations>
236+
<transformers>
237+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/>
238+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
239+
</transformers>
240+
</configuration>
241+
</execution>
242+
</executions>
243+
</plugin>
188244
</plugins>
189245
</build>
190246
</project>

0 commit comments

Comments
 (0)