<?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-jdbc</artifactId>
  <name>${project.artifactId}</name>
  <version>0.3.2-patch10</version>
  <description>JDBC driver for ClickHouse</description>
  <url>https://github.com/ClickHouse/clickhouse-jdbc/tree/master/clickhouse-jdbc</url>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.helger.maven</groupId>
        <artifactId>ph-javacc-maven-plugin</artifactId>
        <version>${javacc-plugin.version}</version>
        <executions>
          <execution>
            <id>jjc</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>javacc</goal>
            </goals>
            <configuration>
              <jdkVersion>1.8</jdkVersion>
              <javadocFriendlyComments>true</javadocFriendlyComments>
              <packageName>com.clickhouse.jdbc.parser</packageName>
              <sourceDirectory>src/main/javacc</sourceDirectory>
              <outputDirectory>src/main/java</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.github.git-commit-id</groupId>
        <artifactId>git-commit-id-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addDefaultEntries>true</addDefaultEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
            </manifest>
            <manifestEntries>
              <Specification-Title>${spec.title}</Specification-Title>
              <Specification-Version>${spec.version}</Specification-Version>
              <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
              <Implementation-Version>${project.artifactId} ${project.version} (revision: ${git.commit.id.abbrev})</Implementation-Version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <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.gson</pattern>
                  <shadedPattern>${shade.base}.gson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache</pattern>
                  <shadedPattern>${shade.base}.apache</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>net.jpountz</pattern>
                  <shadedPattern>${shade.base}.jpountz</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
                <transformer />
                <transformer>
                  <manifestEntries>
                    <Automatic-Module-Name>com.clickhouse.jdbc</Automatic-Module-Name>
                    <Specification-Title>${spec.title}</Specification-Title>
                    <Specification-Version>${spec.version}</Specification-Version>
                    <Implementation-Title>${project.name}</Implementation-Title>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Version>${project.artifactId} ${project.version} (revision: ${git.commit.id.abbrev})</Implementation-Version>
                  </manifestEntries>
                </transformer>
              </transformers>
              <filters>
                <filter>
                  <artifact>com.clickhouse:clickhouse-grpc-client</artifact>
                  <excludes>
                    <exclude>**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>mozilla/**</exclude>
                    <exclude>**/darwin/**</exclude>
                    <exclude>**/linux/**</exclude>
                    <exclude>**/win32/**</exclude>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/DEPENDENCIES</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>META-INF/native-image/**</exclude>
                    <exclude>META-INF/*.xml</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>shade-all</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadedClassifierName>all</shadedClassifierName>
              <relocations>
                <relocation>
                  <pattern>com.google.gson</pattern>
                  <shadedPattern>${shade.base}.gson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache</pattern>
                  <shadedPattern>${shade.base}.apache</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>net.jpountz</pattern>
                  <shadedPattern>${shade.base}.jpountz</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
                <transformer />
                <transformer>
                  <manifestEntries>
                    <Automatic-Module-Name>com.clickhouse.jdbc</Automatic-Module-Name>
                    <Specification-Title>${spec.title}</Specification-Title>
                    <Specification-Version>${spec.version}</Specification-Version>
                    <Implementation-Title>${project.name}</Implementation-Title>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Version>${project.artifactId} ${project.version} (revision: ${git.commit.id.abbrev})</Implementation-Version>
                  </manifestEntries>
                </transformer>
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>mozilla/**</exclude>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/DEPENDENCIES</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>META-INF/native-image/**</exclude>
                    <exclude>META-INF/*.xml</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>shade-grpc</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadedClassifierName>grpc</shadedClassifierName>
              <relocations>
                <relocation>
                  <pattern>com.google.gson</pattern>
                  <shadedPattern>${shade.base}.gson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>net.jpountz</pattern>
                  <shadedPattern>${shade.base}.jpountz</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
                <transformer />
                <transformer>
                  <manifestEntries>
                    <Automatic-Module-Name>com.clickhouse.jdbc</Automatic-Module-Name>
                    <Specification-Title>${spec.title}</Specification-Title>
                    <Specification-Version>${spec.version}</Specification-Version>
                    <Implementation-Title>${project.name}</Implementation-Title>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Version>${project.artifactId} ${project.version} (revision: ${git.commit.id.abbrev})</Implementation-Version>
                  </manifestEntries>
                </transformer>
              </transformers>
              <filters>
                <filter>
                  <artifact>com.clickhouse:clickhouse-http-client</artifact>
                  <excludes>
                    <exclude>**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.httpcomponents:*</artifact>
                  <excludes>
                    <exclude>**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>mozilla/**</exclude>
                    <exclude>**/darwin/**</exclude>
                    <exclude>**/linux/**</exclude>
                    <exclude>**/win32/**</exclude>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/DEPENDENCIES</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>META-INF/native-image/**</exclude>
                    <exclude>META-INF/*.xml</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
          <execution>
            <id>shade-http</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadedClassifierName>http</shadedClassifierName>
              <transformers>
                <transformer />
                <transformer />
                <transformer />
                <transformer>
                  <manifestEntries>
                    <Automatic-Module-Name>com.clickhouse.jdbc</Automatic-Module-Name>
                    <Specification-Title>${spec.title}</Specification-Title>
                    <Specification-Version>${spec.version}</Specification-Version>
                    <Implementation-Title>${project.name}</Implementation-Title>
                    <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                    <Implementation-Version>${project.artifactId} ${project.version} (revision: ${git.commit.id.abbrev})</Implementation-Version>
                  </manifestEntries>
                </transformer>
              </transformers>
              <filters>
                <filter>
                  <artifact>com.clickhouse:clickhouse-grpc-client</artifact>
                  <excludes>
                    <exclude>**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>com.google.code.gson:*</artifact>
                  <excludes>
                    <exclude>**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.commons:commons-compress</artifact>
                  <excludes>
                    <exclude>**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.httpcomponents:*</artifact>
                  <excludes>
                    <exclude>**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>mozilla/**</exclude>
                    <exclude>org/**</exclude>
                    <exclude>ru/**</exclude>
                    <exclude>**/darwin/**</exclude>
                    <exclude>**/linux/**</exclude>
                    <exclude>**/win32/**</exclude>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/DEPENDENCIES</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>META-INF/native-image/**</exclude>
                    <exclude>META-INF/*.xml</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <properties>
    <spec.title>JDBC</spec.title>
    <shade.base>com.clickhouse.jdbc.internal</shade.base>
    <javacc-plugin.version>4.1.4</javacc-plugin.version>
    <httpclient.version>4.5.13</httpclient.version>
    <spec.version>4.2</spec.version>
  </properties>
</project>
