<?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>hydraql</artifactId>
    <groupId>com.hydraql</groupId>
    <version>1.0.2</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>hydraql-shell_1.2</artifactId>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <finalName>${project.artifactId}-${project.version}</finalName>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <id>copy-pom</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/${hydraql.hbase.adapter.version}</outputDirectory>
              <resources>
                <resource>
                  <directory>${basedir}</directory>
                  <includes>
                    <include>pom.xml</include>
                  </includes>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <version>1.5.3</version>
        <executions>
          <execution>
            <id>replace-artifactId</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>replace</goal>
            </goals>
            <configuration>
              <ignoreMissingFile>false</ignoreMissingFile>
              <file>${project.build.directory}/${hydraql.hbase.adapter.version}/pom.xml</file>
              <replacements>
                <replacement>
                  <token>${project.artifactId}</token>
                  <value>${project.artifactId}</value>
                </replacement>
              </replacements>
              <outputDir>${project.build.directory}/${hydraql.hbase.adapter.version}/replacer</outputDir>
              <outputFile>pom.xml</outputFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>templating-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>filter-src</id>
            <goals>
              <goal>filter-sources</goal>
            </goals>
            <configuration>
              <sourceDirectory>${basedir}/src/main/java-templates</sourceDirectory>
              <outputDirectory>${basedir}/src/main/java</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.5.2</version>
        <executions>
          <execution>
            <id>default-install</id>
            <configuration>
              <skip>true</skip>
            </configuration>
          </execution>
          <execution>
            <id>install-scala-version</id>
            <phase>install</phase>
            <goals>
              <goal>install-file</goal>
            </goals>
            <configuration>
              <groupId>${project.groupId}</groupId>
              <artifactId>${project.artifactId}</artifactId>
              <version>${project.version}</version>
              <packaging>${project.packaging}</packaging>
              <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
              <pomFile>${project.build.directory}/${hydraql.hbase.adapter.version}/replacer/pom.xml</pomFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.3</version>
        <executions>
          <execution>
            <id>uber-jar</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createSourcesJar>true</createSourcesJar>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <shadeSourcesContent>true</shadeSourcesContent>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <finalName>${artifactId}-${project.version}</finalName>
              <artifactSet>
                <excludes>
                  <exclude>org.slf4j:*</exclude>
                  <exclude>commons-logging:commons-logging</exclude>
                  <exclude>log4j:log4j</exclude>
                  <exclude>org.apache.logging.log4j:log4j-api</exclude>
                  <exclude>org.apache.logging.log4j:log4j-core</exclude>
                  <exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>org.apache.zookeeper:zookeeper-jute</artifact>
                  <excludes>
                    <exclude>**/*.java</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>LICENSE</exclude>
                    <exclude>META-INF/LICENSE</exclude>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>com.esotericsoftware</pattern>
                  <shadedPattern>${shading.prefix}.com.esotericsoftware</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google</pattern>
                  <shadedPattern>${shading.prefix}.com.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.yetus</pattern>
                  <shadedPattern>${shading.prefix}.org.apache.yetus</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.stringtemplate</pattern>
                  <shadedPattern>${shading.prefix}.org.stringtemplate</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.antlr</pattern>
                  <shadedPattern>${shading.prefix}.org.antlr</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.alibaba.fastjson2</pattern>
                  <shadedPattern>${shading.prefix}.fastjson2</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
                <transformer>
                  <resources>
                    <resource>NOTICE.txt</resource>
                    <resource>NOTICE</resource>
                    <resource>LICENSE</resource>
                    <resource>Log4j-charsets.properties</resource>
                    <resource>Log4j-config.xsd</resource>
                    <resource>Log4j-events.dtd</resource>
                    <resource>Log4j-events.xsd</resource>
                    <resource>Log4j-levels.xsd</resource>
                  </resources>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.30</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.30</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <properties>
    <shading.prefix>hydraql.shaded</shading.prefix>
  </properties>
</project>
