<?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>airbase</artifactId>
    <groupId>io.airlift</groupId>
    <version>88</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.facebook.presto.ranger</groupId>
  <artifactId>ranger-apache</artifactId>
  <name>ranger-apache</name>
  <version>2.1.0-3</version>
  <description>Shaded version of Apache Ranger for Presto</description>
  <url>https://github.com/prestodb/presto-ranger</url>
  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://github.com/prestodb/presto-ranger.git</connection>
    <developerConnection>scm:git:git://github.com/prestodb/presto-ranger.git</developerConnection>
    <tag>2.1.0-3</tag>
    <url>https://github.com/prestodb/presto-ranger</url>
  </scm>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>javadoc</classifier>
              <excludes>
                <exclude>**</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.4</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createSourcesJar>true</createSourcesJar>
              <shadeSourcesContent>true</shadeSourcesContent>
              <dependencyReducedPomLocation>${project.build.directory}/pom.xml</dependencyReducedPomLocation>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <transformers>
                <transformer />
                <transformer />
              </transformers>
              <artifactSet>
                <includes>
                  <include>org.apache.ranger:ranger-plugins-common</include>
                  <include>org.apache.ranger:ranger-plugins-audit</include>
                  <include>org.apache.ranger:ranger-plugin-classloader</include>
                  <include>org.apache.ranger:ranger-plugins-cred</include>
                  <include>com.google.code.gson:gson</include>
                  <include>commons-collections:commons-collections</include>
                  <include>org.apache.httpcomponents:*</include>
                  <include>com.carrotsearch:hppc</include>
                  <include>org.apache.zookeeper:zookeeper</include>
                  <include>org.elasticsearch:elasticsearch</include>
                  <include>org.elasticsearch:*</include>
                  <include>org.elasticsearch.plugin:*</include>
                  <include>org.elasticsearch.client:*</include>
                  <include>org.apache.lucene:*</include>
                  <include>org.apache.solr:solr-solrj</include>
                  <include>commons-lang:commons-lang</include>
                  <include>org.codehaus.jackson:*</include>
                  <include>commons-io:commons-io</include>
                  <include>org.slf4j:jcl-over-slf4j</include>
                  <include>commons-codec:commons-codec</include>
                  <include>org.apache.commons:commons-math3</include>
                  <include>com.kstruct:gethostname4j</include>
                  <include>com.fasterxml.jackson.dataformat:*</include>
                  <include>com.fasterxml.jackson.core:jackson-core</include>
                  <include>org.noggit:noggit</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.google.gson</pattern>
                  <shadedPattern>${shadeBase}.com.google.gson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons</pattern>
                  <shadedPattern>${shadeBase}.org.apache.commons</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.http</pattern>
                  <shadedPattern>${shadeBase}.org.apache.http</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.carrotsearch.hppc</pattern>
                  <shadedPattern>${shadeBase}.com.carrotsearch.hppc</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.zookeeper</pattern>
                  <shadedPattern>${shadeBase}.org.apache.zookeeper</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.jute</pattern>
                  <shadedPattern>${shadeBase}.org.apache.jute</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.lucene</pattern>
                  <shadedPattern>${shadeBase}.org.apache.lucene</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.solr</pattern>
                  <shadedPattern>${shadeBase}.org.apache.solr</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.codehaus.jackson</pattern>
                  <shadedPattern>${shadeBase}.org.codehaus.jackson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.elasticsearch</pattern>
                  <shadedPattern>${shadeBase}.org.elasticsearch</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.kstruct.gethostname4j</pattern>
                  <shadedPattern>${shadeBase}.com.kstruct.gethostname4j</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.fasterxml.jackson</pattern>
                  <shadedPattern>${shadeBase}.com.fasterxml.jackson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.noggit</pattern>
                  <shadedPattern>${shadeBase}.org.noggit</shadedPattern>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>service-defs/**</exclude>
                    <exclude>etc/**</exclude>
                    <exclude>mozilla/**</exclude>
                    <exclude>assets/org/apache/commons/math3/exception/util/LocalizedFormats_fr.properties</exclude>
                    <exclude>assets/org/apache/commons/math3/random/new-joe-kuo-6.1000</exclude>
                    <exclude>apispec/*</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <preparationGoals>clean install -DskipTests</preparationGoals>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${dep.nexus-staging-plugin.version}</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>oss-release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <sourceFileExcludes>
                    <exclude>**</exclude>
                  </sourceFileExcludes>
                  <quiet>true</quiet>
                  <source>1.8</source>
                  <encoding>UTF-8</encoding>
                  <maxmemory>1024m</maxmemory>
                  <additionalOptions>-Xdoclint:all</additionalOptions>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <sourceFileExcludes>
                <exclude>**</exclude>
              </sourceFileExcludes>
              <quiet>true</quiet>
              <source>1.8</source>
              <encoding>UTF-8</encoding>
              <maxmemory>1024m</maxmemory>
              <additionalOptions>-Xdoclint:all</additionalOptions>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <useAgent>true</useAgent>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <useAgent>true</useAgent>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <skipTests>true</skipTests>
      </properties>
    </profile>
    <profile>
      <id>deploy-to-ossrh</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
      <version>5.2.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.hdrhistogram</groupId>
      <artifactId>HdrHistogram</artifactId>
      <version>2.1.9</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <properties>
    <dep.nexus-staging-plugin.version>1.6.8</dep.nexus-staging-plugin.version>
    <dep.ranger.version>2.1.0</dep.ranger.version>
    <air.check.skip-checkstyle>true</air.check.skip-checkstyle>
    <air.check.skip-dependency>true</air.check.skip-dependency>
    <shadeBase>com.facebook.presto.ranger.\$internal</shadeBase>
    <air.check.skip-spotbugs>true</air.check.skip-spotbugs>
    <air.check.skip-duplicate-finder>true</air.check.skip-duplicate-finder>
  </properties>
</project>
