<?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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>ru.yandex.clickhouse</groupId>
  <artifactId>clickhouse-jdbc-bridge</artifactId>
  <name>ClickHouse JDBC Bridge</name>
  <version>${revision}</version>
  <description>JDBC bridge for ClickHouse.</description>
  <url>https://github.com/ClickHouse/clickhouse-jdbc-bridge</url>
  <inceptionYear>2019</inceptionYear>
  <developers>
    <developer>
      <name>Zhichun Wu</name>
      <email>zhicwu@gmail.com</email>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git@github.com:ClickHouse/clickhouse-jdbc-bridge.git</connection>
    <developerConnection>scm:git:git@github.com:ClickHouse/clickhouse-jdbc-bridge.git</developerConnection>
    <tag>${project.version}</tag>
    <url>https://github.com/ClickHouse/clickhouse-jdbc-bridge</url>
  </scm>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.jasig.maven</groupId>
        <artifactId>maven-notice-plugin</artifactId>
        <version>${notice-plugin.version}</version>
        <executions>
          <execution>
            <id>check-license</id>
            <phase>initialize</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <noticeTemplate>misc/notice.template</noticeTemplate>
          <licenseMapping>
            <param>misc/license-mappings.xml</param>
          </licenseMapping>
          <generateChildNotices>false</generateChildNotices>
          <includeChildDependencies>false</includeChildDependencies>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <version>${replacer-plugin.version}</version>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>replace</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <file>src/main/resources/log4j.properties</file>
          <outputFile>target/classes/log4j.properties</outputFile>
          <replacements>
            <replacement>
              <token>org.apache.log4j</token>
              <value>${shade.base}.log4j</value>
            </replacement>
          </replacements>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-plugin.version}</version>
        <executions>
          <execution>
            <id>check-license</id>
            <phase>initialize</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <header>misc/license-header.template</header>
          <properties>
            <inceptionYear>${project.inceptionYear}</inceptionYear>
            <latestYearOfContribution>${project.current.year}</latestYearOfContribution>
          </properties>
          <includes>
            <include>src/**/*.java</include>
          </includes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler-plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire-plugin.version}</version>
        <configuration>
          <groups>unit</groups>
          <skipTests>${skipUTs}</skipTests>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${failsafe-plugin.version}</version>
        <executions>
          <execution>
            <id>run-integration-tests</id>
            <phase>integration-test</phase>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <includes>**/*.java</includes>
          <groups>sit</groups>
          <skipTests>${skipTests}</skipTests>
          <skipITs>${skipITs}</skipITs>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${jar-plugin.version}</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>ru.yandex.clickhouse.jdbcbridge.JdbcBridgeVerticle</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${shade-plugin.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <shadedArtifactAttached>false</shadedArtifactAttached>
          <createDependencyReducedPom>true</createDependencyReducedPom>
          <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
          <shadedClassifierName>shaded</shadedClassifierName>
          <relocations>
            <relocation>
              <pattern>com.github</pattern>
              <shadedPattern>${shade.base}.github</shadedPattern>
            </relocation>
            <relocation>
              <pattern>com.zaxxer</pattern>
              <shadedPattern>${shade.base}.zaxxer</shadedPattern>
            </relocation>
            <relocation>
              <pattern>io.dropwizard</pattern>
              <shadedPattern>${shade.base}.dropwizard</shadedPattern>
            </relocation>
            <relocation>
              <pattern>io.micrometer</pattern>
              <shadedPattern>${shade.base}.micrometer</shadedPattern>
            </relocation>
            <relocation>
              <pattern>io.prometheus</pattern>
              <shadedPattern>${shade.base}.prometheus</shadedPattern>
            </relocation>
            <relocation>
              <pattern>io.vertx</pattern>
              <shadedPattern>${shade.base}.vertx</shadedPattern>
            </relocation>
            <relocation>
              <pattern>io.netty</pattern>
              <shadedPattern>${shade.base}.netty</shadedPattern>
            </relocation>
            <relocation>
              <pattern>com.fasterxml.jackson</pattern>
              <shadedPattern>${shade.base}.jackson</shadedPattern>
            </relocation>
            <relocation>
              <pattern>com.google</pattern>
              <shadedPattern>${shade.base}.google</shadedPattern>
            </relocation>
            <relocation>
              <pattern>com.codahale.metrics</pattern>
              <shadedPattern>${shade.base}.metrics</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.apache.log4j</pattern>
              <shadedPattern>${shade.base}.log4j</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.checkerframework</pattern>
              <shadedPattern>${shade.base}.checker</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.xbill.DNS</pattern>
              <shadedPattern>${shade.base}.dnsjava</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.slf4j</pattern>
              <shadedPattern>${shade.base}.slf4j</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.HdrHistogram</pattern>
              <shadedPattern>${shade.base}.HdrHistogram</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.LatencyUtils</pattern>
              <shadedPattern>${shade.base}.LatencyUtils</shadedPattern>
            </relocation>
          </relocations>
          <transformers>
            <transformer />
            <transformer />
            <transformer />
          </transformers>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/maven/**</exclude>
                <exclude>META-INF/native-image/**</exclude>
                <exclude>META-INF/versions/**</exclude>
                <exclude>META-INF/*.xml</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>com.github.fracpete</groupId>
            <artifactId>debian-maven-plugin</artifactId>
            <version>1.0.20</version>
            <executions>
              <execution>
                <id>generate-deb</id>
                <goals>
                  <goal>package</goal>
                </goals>
                <configuration>
                  <projectUrl>https://github.com/ClickHouse/clickhouse-jdbc-bridge</projectUrl>
                  <projectOrganization>Zhichun Wu</projectOrganization>
                  <packageDescription>JDBC bridge for ClickHouse. It acts as a stateless proxy passing queries from ClickHouse to external datasources.</packageDescription>
                  <createSymLinks>true</createSymLinks>
                  <createIncludeFiles>false</createIncludeFiles>
                  <excludeAllArtifacts>false</excludeAllArtifacts>
                  <excludeAllDependencies>true</excludeAllDependencies>
                  <libDirectory>/usr/local/lib/java</libDirectory>
                  <useDefaultCopyResources>false</useDefaultCopyResources>
                  <useDefaultFixPermissions>true</useDefaultFixPermissions>
                  <copyResources>
                    <copyResource>
                      <source>docker</source>
                      <target>target/deb/etc/clickhouse-jdbc-bridge</target>
                      <include>.*\.properties</include>
                    </copyResource>
                    <copyResource>
                      <source>docker</source>
                      <target>target/deb/etc/clickhouse-jdbc-bridge</target>
                      <include>.*\.example</include>
                    </copyResource>
                    <copyResource>
                      <source>docker/config</source>
                      <target>target/deb/etc/clickhouse-jdbc-bridge/config</target>
                      <include>.*</include>
                    </copyResource>
                    <copyResource>
                      <source>src/main/bin</source>
                      <target>target/deb/usr/local/bin</target>
                      <include>.*</include>
                    </copyResource>
                  </copyResources>
                  <packageDependencies>
                    <packageDependency>default-jre</packageDependency>
                  </packageDependencies>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <projectUrl>https://github.com/ClickHouse/clickhouse-jdbc-bridge</projectUrl>
              <projectOrganization>Zhichun Wu</projectOrganization>
              <packageDescription>JDBC bridge for ClickHouse. It acts as a stateless proxy passing queries from ClickHouse to external datasources.</packageDescription>
              <createSymLinks>true</createSymLinks>
              <createIncludeFiles>false</createIncludeFiles>
              <excludeAllArtifacts>false</excludeAllArtifacts>
              <excludeAllDependencies>true</excludeAllDependencies>
              <libDirectory>/usr/local/lib/java</libDirectory>
              <useDefaultCopyResources>false</useDefaultCopyResources>
              <useDefaultFixPermissions>true</useDefaultFixPermissions>
              <copyResources>
                <copyResource>
                  <source>docker</source>
                  <target>target/deb/etc/clickhouse-jdbc-bridge</target>
                  <include>.*\.properties</include>
                </copyResource>
                <copyResource>
                  <source>docker</source>
                  <target>target/deb/etc/clickhouse-jdbc-bridge</target>
                  <include>.*\.example</include>
                </copyResource>
                <copyResource>
                  <source>docker/config</source>
                  <target>target/deb/etc/clickhouse-jdbc-bridge/config</target>
                  <include>.*</include>
                </copyResource>
                <copyResource>
                  <source>src/main/bin</source>
                  <target>target/deb/usr/local/bin</target>
                  <include>.*</include>
                </copyResource>
              </copyResources>
              <packageDependencies>
                <packageDependency>default-jre</packageDependency>
              </packageDependencies>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>rpm-maven-plugin</artifactId>
            <version>2.2.0</version>
            <executions>
              <execution>
                <id>generate-rpm</id>
                <goals>
                  <goal>rpm</goal>
                </goals>
                <configuration>
                  <license>Apache License 2.0</license>
                  <group>Applications/Databases</group>
                  <changelogFile>src/changelog</changelogFile>
                  <defineStatements>
                    <defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
                  </defineStatements>
                  <requires>
                    <require>jre-headless &gt;= 1.8</require>
                  </requires>
                  <mappings>
                    <mapping>
                      <directory>/etc/clickhouse-jdbc-bridge</directory>
                      <filemode>0644</filemode>
                      <username>root</username>
                      <groupname>root</groupname>
                      <sources>
                        <source>
                          <location>docker/log4j.properties</location>
                        </source>
                        <source>
                          <location>docker/set-env.sh.example</location>
                        </source>
                      </sources>
                    </mapping>
                    <mapping>
                      <directory>/etc/clickhouse-jdbc-bridge/config</directory>
                      <filemode>0644</filemode>
                      <username>root</username>
                      <groupname>root</groupname>
                      <sources>
                        <source>
                          <location>docker/config</location>
                        </source>
                      </sources>
                    </mapping>
                    <mapping>
                      <directory>/usr/local/lib/java</directory>
                      <filemode>0644</filemode>
                      <username>root</username>
                      <groupname>root</groupname>
                      <sources>
                        <source>
                          <location>target/clickhouse-jdbc-bridge-1.2.0.jar</location>
                        </source>
                        <softlinkSource>
                          <location>/usr/local/lib/java/clickhouse-jdbc-bridge-1.2.0.jar</location>
                          <destination>clickhouse-jdbc-bridge.jar</destination>
                        </softlinkSource>
                      </sources>
                    </mapping>
                    <mapping>
                      <directory>/usr/local/bin</directory>
                      <filemode>0755</filemode>
                      <username>root</username>
                      <groupname>root</groupname>
                      <sources>
                        <source>
                          <location>src/main/bin</location>
                        </source>
                      </sources>
                    </mapping>
                  </mappings>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <license>Apache License 2.0</license>
              <group>Applications/Databases</group>
              <changelogFile>src/changelog</changelogFile>
              <defineStatements>
                <defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
              </defineStatements>
              <requires>
                <require>jre-headless &gt;= 1.8</require>
              </requires>
              <mappings>
                <mapping>
                  <directory>/etc/clickhouse-jdbc-bridge</directory>
                  <filemode>0644</filemode>
                  <username>root</username>
                  <groupname>root</groupname>
                  <sources>
                    <source>
                      <location>docker/log4j.properties</location>
                    </source>
                    <source>
                      <location>docker/set-env.sh.example</location>
                    </source>
                  </sources>
                </mapping>
                <mapping>
                  <directory>/etc/clickhouse-jdbc-bridge/config</directory>
                  <filemode>0644</filemode>
                  <username>root</username>
                  <groupname>root</groupname>
                  <sources>
                    <source>
                      <location>docker/config</location>
                    </source>
                  </sources>
                </mapping>
                <mapping>
                  <directory>/usr/local/lib/java</directory>
                  <filemode>0644</filemode>
                  <username>root</username>
                  <groupname>root</groupname>
                  <sources>
                    <source>
                      <location>target/clickhouse-jdbc-bridge-1.2.0.jar</location>
                    </source>
                    <softlinkSource>
                      <location>/usr/local/lib/java/clickhouse-jdbc-bridge-1.2.0.jar</location>
                      <destination>clickhouse-jdbc-bridge.jar</destination>
                    </softlinkSource>
                  </sources>
                </mapping>
                <mapping>
                  <directory>/usr/local/bin</directory>
                  <filemode>0755</filemode>
                  <username>root</username>
                  <groupname>root</groupname>
                  <sources>
                    <source>
                      <location>src/main/bin</location>
                    </source>
                  </sources>
                </mapping>
              </mappings>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>3.0.0-M1</version>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
                <configuration>
                  <skip>true</skip>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
                <configuration>
                  <serverId>ossrh</serverId>
                  <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <vertx.version>3.9.5</vertx.version>
    <dnsjava.version>3.3.1</dnsjava.version>
    <micrometer.version>1.1.19</micrometer.version>
    <shade-plugin.version>3.2.4</shade-plugin.version>
    <javadoc-plugin.version>3.2.0</javadoc-plugin.version>
    <compiler-plugin.version>3.8.1</compiler-plugin.version>
    <project.current.year>2021</project.current.year>
    <notice-plugin.version>1.1.0</notice-plugin.version>
    <skipITs>${skipTests}</skipITs>
    <deploy-plugin.version>3.0.0-M1</deploy-plugin.version>
    <jar-plugin.version>3.2.0</jar-plugin.version>
    <testng.version>6.14.3</testng.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <revision>2.0.0-SNAPSHOT</revision>
    <shade.base>ru.yandex.clickhouse.jdbcbridge.internal</shade.base>
    <caffeine.version>2.8.6</caffeine.version>
    <gpg-plugin.version>1.6</gpg-plugin.version>
    <java.version>1.8</java.version>
    <slf4j.version>1.7.30</slf4j.version>
    <hikaricp.version>3.4.5</hikaricp.version>
    <surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
    <license-plugin.version>2.11</license-plugin.version>
    <staging-plugin.version>1.6.8</staging-plugin.version>
    <skipTests>false</skipTests>
    <source-plugin.version>3.2.1</source-plugin.version>
    <failsafe-plugin.version>3.0.0-M5</failsafe-plugin.version>
    <skipUTs>${skipTests}</skipUTs>
    <rpm-plugin.version>2.2.0</rpm-plugin.version>
    <deb-plugin.version>1.0.20</deb-plugin.version>
    <main.basedir>${project.basedir}</main.basedir>
    <replacer-plugin.version>1.5.3</replacer-plugin.version>
    <testcontainers.version>1.15.1</testcontainers.version>
  </properties>
</project>
