Skip to content

Commit

Permalink
Add jetcd-core-shaded module which uses grpc-netty-shaded
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Jun 12, 2024
1 parent d6683ca commit b11f402
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 9 deletions.
2 changes: 0 additions & 2 deletions distribution/server/src/assemble/LICENSE.bin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ The Apache Software License, Version 2.0
- io.grpc-grpc-auth-1.56.0.jar
- io.grpc-grpc-context-1.56.0.jar
- io.grpc-grpc-core-1.56.0.jar
- io.grpc-grpc-netty-1.56.0.jar
- io.grpc-grpc-protobuf-1.56.0.jar
- io.grpc-grpc-protobuf-lite-1.56.0.jar
- io.grpc-grpc-stub-1.56.0.jar
Expand Down Expand Up @@ -498,7 +497,6 @@ The Apache Software License, Version 2.0
- io.vertx-vertx-core-4.5.8.jar
- io.vertx-vertx-web-4.5.8.jar
- io.vertx-vertx-web-common-4.5.8.jar
- io.vertx-vertx-grpc-4.5.8.jar
* Apache ZooKeeper
- org.apache.zookeeper-zookeeper-3.9.2.jar
- org.apache.zookeeper-zookeeper-jute-3.9.2.jar
Expand Down
125 changes: 125 additions & 0 deletions jetcd-core-shaded/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar</artifactId>
<version>3.4.0-SNAPSHOT</version>
</parent>

<artifactId>jetcd-core-shaded</artifactId>
<name>Apache Pulsar :: jetcd-core shaded</name>

<dependencies>
<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<minimizeJar>false</minimizeJar>
<artifactSet>
<includes>
<include>io.etcd:*</include>
<include>io.vertx:*</include>
</includes>
</artifactSet>
<relocations>
<!-- relocate vertx packages since they will be transformed to use grpc-netty-shaded packages -->
<relocation>
<pattern>io.vertx</pattern>
<shadedPattern>org.apache.pulsar.jetcd.shaded.io.vertx</shadedPattern>
</relocation>
<!-- relocate to use grpc-netty-shaded packages -->
<relocation>
<pattern>io.grpc.netty</pattern>
<shadedPattern>io.grpc.netty.shaded.io.grpc.netty</shadedPattern>
</relocation>
<!-- relocate to use grpc-netty-shaded packages -->
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>io.grpc.netty.shaded.io.netty</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"/>
</transformers>
<!-- required for IntelliJ support -->
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
<!-- required for IntelliJ support, for some reason shadedArtifactAttached isn't sufficient alone -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-shaded-jar</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/${project.artifactId}-${project.version}-shaded.jar</file>
<type>jar</type>
<classifier>shaded</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
25 changes: 24 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ flexible messaging model and an intuitive client API.</description>
<maven-modernizer-plugin.version>2.3.0</maven-modernizer-plugin.version>
<maven-shade-plugin>3.4.1</maven-shade-plugin>
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
<properties-maven-plugin.version>1.1.0</properties-maven-plugin.version>
<nifi-nar-maven-plugin.version>1.5.0</nifi-nar-maven-plugin.version>
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
Expand Down Expand Up @@ -1053,12 +1054,24 @@ flexible messaging model and an intuitive client API.</description>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
<version>${jetcd.version}</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-test</artifactId>
<version>${jetcd.version}</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -1152,6 +1165,10 @@ flexible messaging model and an intuitive client API.</description>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down Expand Up @@ -2142,6 +2159,11 @@ flexible messaging model and an intuitive client API.</description>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<extensions>
Expand Down Expand Up @@ -2387,6 +2409,7 @@ flexible messaging model and an intuitive client API.</description>
<module>pulsar-client-messagecrypto-bc</module>

<module>pulsar-metadata</module>
<module>jetcd-core-shaded</module>
<module>jclouds-shaded</module>

<!-- package management releated modules (begin) -->
Expand Down Expand Up @@ -2452,7 +2475,7 @@ flexible messaging model and an intuitive client API.</description>
<!-- all these modules should be put at the end in this exact sequence -->
<module>distribution</module>
<module>pulsar-metadata</module>

<module>jetcd-core-shaded</module>
<!-- package management releated modules (begin) -->
<module>pulsar-package-management</module>
<!-- package management releated modules (end) -->
Expand Down
32 changes: 32 additions & 0 deletions pulsar-broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,42 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jetcd-core-shaded</artifactId>
<version>${project.version}</version>
<classifier>shaded</classifier>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</exclusion>
<exclusion>
<groupId>io.vertx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
31 changes: 28 additions & 3 deletions pulsar-metadata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,40 @@
</dependency>

<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>jetcd-core-shaded</artifactId>
<version>${project.version}</version>
<classifier>shaded</classifier>
<exclusions>
<exclusion>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
</dependency>


<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</exclusion>
<exclusion>
<groupId>io.vertx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
import io.etcd.jetcd.watch.WatchResponse;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
import io.grpc.netty.GrpcSslContexts;
import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts;
import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
import io.grpc.netty.shaded.io.netty.handler.ssl.SslProvider;
import io.grpc.stub.StreamObserver;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslProvider;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down

0 comments on commit b11f402

Please sign in to comment.