<!--

    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</groupId>
        <artifactId>apache</artifactId>
        <version>18</version>
    </parent>

    <groupId>org.apache.pulsar</groupId>
    <artifactId>pulsar-presto-distribution</artifactId>
    <name>Pulsar SQL :: Pulsar Presto Distribution</name>
    <version>2.4.1</version>

    <properties>
        <presto.version>0.206</presto.version>
        <airlift.version>0.170</airlift.version>
        <objenesis.version>2.6</objenesis.version>
        <objectsize.version>0.0.12</objectsize.version>
        <guice.version>4.2.0</guice.version>
        <!-- Launcher properties -->
        <main-class>com.facebook.presto.server.PrestoServer</main-class>
        <process-name>${project.artifactId}</process-name>
        <jackson.version>2.8.11</jackson.version>
        <!--fix Security Vulnerabilities-->
        <!--https://www.cvedetails.com/vulnerability-list/vendor_id-15866/product_id-42991/Fasterxml-Jackson-databind.html-->
        <jackson.databind.version>2.8.11.4</jackson.databind.version>
        <com.ning.async.http.client.version>1.9.40</com.ning.async.http.client.version>
        <maven.version>3.0.5</maven.version>
        <guava.version>25.1-jre</guava.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-main</artifactId>
            <version>${presto.version}</version>
            <exclusions>
                <!-- exclude openjdk because of GPL license -->
                <exclusion>
                    <groupId>org.openjdk.jol</groupId>
                    <artifactId>jol-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.activation</groupId>
                    <artifactId>activation</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-cli</artifactId>
            <version>${presto.version}</version>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>launcher</artifactId>
            <version>${airlift.version}</version>
            <type>tar.gz</type>
            <classifier>bin</classifier>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>launcher</artifactId>
            <version>${airlift.version}</version>
            <type>tar.gz</type>
            <classifier>properties</classifier>
        </dependency>

        <dependency>
            <groupId>org.apache.pulsar</groupId>
            <artifactId>pulsar-presto-connector</artifactId>
            <version>${project.version}</version>
            <type>tar.gz</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
            <version>${objenesis.version}</version>
        </dependency>

        <dependency>
            <groupId>com.twitter.common</groupId>
            <artifactId>objectsize</artifactId>
            <version>${objectsize.version}</version>
        </dependency>

        <!-- make sure guice is set to the correct version -->
        <dependency>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-multibindings</artifactId>
            <version>${guice.version}</version>
        </dependency>

        <!-- jackson dependencies -->

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.databind.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-joda</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-guava</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jdk8</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-smile</artifactId>
            <version>${jackson.version}</version>
        </dependency>

    </dependencies>
    
    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>com.ning</groupId>
          <artifactId>async-http-client</artifactId>
          <version>${com.ning.async.http.client.version}</version>
        </dependency>
        <dependency>
          <groupId>io.netty</groupId>
          <artifactId>netty</artifactId>
          <version>3.10.6.Final</version>
        </dependency>
      
        <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-core</artifactId>
          <version>${maven.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-model</artifactId>
          <version>${maven.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-artifact</artifactId>
          <version>${maven.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-aether-provider</artifactId>
          <version>${maven.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-embedder</artifactId>
          <version>${maven.version}</version>
        </dependency>
        <dependency>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
          <version>${guava.version}</version>
        </dependency>
      </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <attach>true</attach>
                    <tarLongFileMode>posix</tarLongFileMode>
                    <descriptors>
                        <descriptor>src/assembly/assembly.xml</descriptor>
                    </descriptors>
                    <finalName>${project.artifactId}</finalName>
                </configuration>
                <executions>
                    <execution>
                        <id>package</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>templating-maven-plugin</artifactId>
                <version>1.0.0</version>
                <executions>
                    <execution>
                        <id>filter-src</id>
                        <goals>
                            <goal>filter-sources</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <sourceDirectory>${project.build.directory}/${project.artifactId}/bin/</sourceDirectory>
                            <outputDirectory>${project.build.directory}/${project.artifactId}/bin/</outputDirectory>
                            <overwrite>true</overwrite>
                            <delimiters>
                                <delimiter>${*}</delimiter>
                            </delimiters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0.rc1</version>
                <configuration>
                    <header>../../src/license-header.txt</header>
                </configuration>
            </plugin>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <source>1.8</source>
                <target>1.8</target>
              </configuration>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>2.10</version>
            </extension>
        </extensions>
    </build>
</project>
