<?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 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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache.phoenix</groupId>
    <artifactId>phoenix</artifactId>
    <version>4.11.0-HBase-1.1</version>
  </parent>
  <artifactId>phoenix-queryserver-client</artifactId>
  <name>Phoenix Query Server Client</name>
  <description>A thin JDBC client for interacting with the query server</description>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments/>
    </license>
  </licenses>

  <organization>
    <name>Apache Software Foundation</name>
    <url>http://www.apache.org</url>
  </organization>

  <properties>
    <top.dir>${project.basedir}/..</top.dir>
    <shaded.package>org.apache.phoenix.shaded</shaded.package>
    <protobuf-java.version>3.1.0</protobuf-java.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <skipAssembly>true</skipAssembly>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>thin-client</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <finalName>phoenix-${project.version}-thin-client</finalName>

              <transformers>
                <transformer
                    implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                  <resource>README.md</resource>
                  <file>${project.basedir}/../README.md</file>
                </transformer>
                <transformer
                    implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                  <resource>LICENSE.txt</resource>
                  <file>${project.basedir}/../LICENSE</file>
                </transformer>
                <transformer
                    implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                  <resource>NOTICE</resource>
                  <file>${project.basedir}/../NOTICE</file>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/license/*</exclude>
                    <exclude>LICENSE.*</exclude>
                    <exclude>NOTICE.*</exclude>
                  </excludes>
                </filter>
              </filters>

              <relocations>

                <!-- COM relocation -->

                <relocation>
                  <pattern>com.fasterxml</pattern>
                  <shadedPattern>${shaded.package}.com.fasterxml</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.collect</pattern>
                  <shadedPattern>${shaded.package}.com.google.collect</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.protobuf</pattern>
                  <shadedPattern>${shaded.package}.com.google.protobuf</shadedPattern>
                </relocation>
                <!-- ORG relocation -->
                <!-- Calcite/Avatica is not relocated because the wire API (as of <=1.8.0) expects
                     consistent class names on client and server. Relocating these would break
                     backwards compatibility. -->
                <relocation>
                  <pattern>org.apache.commons</pattern>
                  <shadedPattern>${shaded.package}.org.apache.commons</shadedPattern>
                  <excludes>
                    <exclude>org.apache.commons.logging.**</exclude>
                  </excludes>
                </relocation>
                <relocation>
                  <pattern>org.apache.http</pattern>
                  <shadedPattern>${shaded.package}.org.apache.http</shadedPattern>
                </relocation>

                <relocation>
                  <pattern>org.fusesource</pattern>
                  <shadedPattern>${shaded.package}.org.fusesource</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.hamcrest</pattern>
                  <shadedPattern>${shaded.package}.org.hamcrest</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.junit</pattern>
                  <shadedPattern>${shaded.package}.org.junit</shadedPattern>
                </relocation>

                <!-- MISC relocations -->

                <relocation>
                  <pattern>jline</pattern>
                  <shadedPattern>${shaded.package}.jline</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>junit</pattern>
                  <shadedPattern>${shaded.package}.junit</shadedPattern>
                </relocation>

              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>src/main/resources/META-INF/services/java.sql.Driver</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.calcite.avatica</groupId>
      <artifactId>avatica-core</artifactId>
    </dependency>
    <dependency>
      <!-- a dependency for the thin-client uberjar -->
      <groupId>sqlline</groupId>
      <artifactId>sqlline</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
    </dependency>
  </dependencies>
</project>
