<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <parent>
    <artifactId>clickhouse-java</artifactId>
    <groupId>com.clickhouse</groupId>
    <version>0.3.2-patch10</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>clickhouse-grpc-client</artifactId>
  <name>${project.artifactId}</name>
  <version>0.3.2-patch10</version>
  <description>gRPC client for ClickHouse</description>
  <url>https://github.com/ClickHouse/clickhouse-jdbc/tree/master/clickhouse-grpc-client</url>
  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>shade</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadedClassifierName>shaded</shadedClassifierName>
              <relocations>
                <relocation>
                  <pattern>com.google</pattern>
                  <shadedPattern>${shade.base}.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.squareup.okhttp</pattern>
                  <shadedPattern>${shade.base}.okhttp</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>okio</pattern>
                  <shadedPattern>${shade.base}.okio</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.grpc</pattern>
                  <shadedPattern>${shade.base}.grpc</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.perfmark</pattern>
                  <shadedPattern>${shade.base}.perfmark</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.opencensus</pattern>
                  <shadedPattern>${shade.base}.opencensus</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
                <transformer />
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>android/**</exclude>
                    <exclude>google/**</exclude>
                    <exclude>javax/**</exclude>
                    <exclude>org/**</exclude>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>META-INF/native-image/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>shade-netty</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadedClassifierName>netty</shadedClassifierName>
              <relocations>
                <relocation>
                  <pattern>com.google</pattern>
                  <shadedPattern>${shade.base}.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.grpc</pattern>
                  <shadedPattern>${shade.base}.grpc</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.perfmark</pattern>
                  <shadedPattern>${shade.base}.perfmark</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.opencensus</pattern>
                  <shadedPattern>${shade.base}.opencensus</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
                <transformer />
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>android/**</exclude>
                    <exclude>com/squareup/**</exclude>
                    <exclude>google/**</exclude>
                    <exclude>io/grpc/okhttp/**</exclude>
                    <exclude>javax/**</exclude>
                    <exclude>okio/**</exclude>
                    <exclude>org/**</exclude>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>META-INF/native-image/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>shade-okhttp</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadedClassifierName>okhttp</shadedClassifierName>
              <relocations>
                <relocation>
                  <pattern>com.google</pattern>
                  <shadedPattern>${shade.base}.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.squareup.okhttp</pattern>
                  <shadedPattern>${shade.base}.okhttp</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>okio</pattern>
                  <shadedPattern>${shade.base}.okio</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.grpc</pattern>
                  <shadedPattern>${shade.base}.grpc</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.perfmark</pattern>
                  <shadedPattern>${shade.base}.perfmark</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.opencensus</pattern>
                  <shadedPattern>${shade.base}.opencensus</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
                <transformer />
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>android/**</exclude>
                    <exclude>google/**</exclude>
                    <exclude>io/grpc/netty/**</exclude>
                    <exclude>javax/**</exclude>
                    <exclude>org/**</exclude>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>META-INF/native/**</exclude>
                    <exclude>META-INF/native-image/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/protobuf/grpc-java</source>
                <source>target/generated-sources/protobuf/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <properties>
    <shade.base>com.clickhouse.client.internal</shade.base>
  </properties>
</project>
