<?xml version="1.0" encoding="UTF-8"?>
<!--
  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">
  <parent>
    <artifactId>hudi</artifactId>
    <groupId>org.apache.hudi</groupId>
    <version>0.11.0-h0.cbu.mrs.331.r10</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>hudi-timeline-service</artifactId>
  <packaging>jar</packaging>

  <properties>
    <main.basedir>${project.parent.basedir}</main.basedir>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
            <phase>test-compile</phase>
          </execution>
        </executions>
        <configuration>
          <skip>false</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven-shade-plugin.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml
              </dependencyReducedPomLocation>
              <artifactSet>
                <includes>
                  <include>org.apache.hudi:hudi-timeline-service</include>

                  <include>org.mortbay.jetty:jetty</include>
                  <include>org.mortbay.jetty:jetty-util</include>
                  <include>org.apache.httpcomponents:fluent-hc</include>
                  <include>io.javalin:javalin</include>
                  <include>org.eclipse.jetty.websocket</include>
                  <include>org.jetbrains.kotlin:kotlin-stdlib-jdk8</include>
                  <include>org.jetbrains.kotlin:kotlin-stdlib</include>
                  <include>org.jetbrains.kotlin:kotlin-stdlib-common</include>
                  <include>org.jetbrains.kotlin:kotlin-stdlib-jdk7</include>
                  <include>org.jetbrains.kotlin:kotlin-stdlib-jdk8</include>
                  <include>org.eclipse.jetty.websocket:websocket-server</include>
                  <include>org.eclipse.jetty.websocket:websocket-common</include>
                  <include>org.eclipse.jetty.websocket:websocket-api</include>
                  <include>org.eclipse.jetty.websocket:websocket-client</include>
                  <include>org.eclipse.jetty.websocket:websocket-servlet</include>
                  <include>org.eclipse.jetty:jetty-server</include>
                  <include>org.eclipse.jetty:jetty-http</include>
                  <include>org.eclipse.jetty:jetty-util</include>
                  <include>org.eclipse.jetty:jetty-io</include>
                  <include>org.eclipse.jetty:jetty-webapp</include>
                  <include>org.eclipse.jetty:jetty-xml</include>
                  <include>org.eclipse.jetty:jetty-servlet</include>
                  <include>org.eclipse.jetty:jetty-security</include>
                  <include>org.eclipse.jetty:jetty-client</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>org.mortbay.</pattern>
                  <shadedPattern>org.hudi_project.org.mortbay.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.http.client.fluent.</pattern>
                  <shadedPattern>org.hudi_project.org.apache.http.client.fluent.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.javalin.</pattern>
                  <shadedPattern>org.hudi_project.io.javalin.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse.jetty.websocket</pattern>
                  <shadedPattern>org.hudi_project.org.eclipse.jetty.websocket</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>kotlin.</pattern>
                  <shadedPattern>org.hudi_project.kotlin.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse.jetty.websocket.</pattern>
                  <shadedPattern>org.hudi_project.org.eclipse.jetty.websocket.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse.jetty.</pattern>
                  <shadedPattern>org.hudi_project.org.eclipse.jetty.</shadedPattern>
                </relocation>
              </relocations>
              <createDependencyReducedPom>false</createDependencyReducedPom>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/services/javax.*</exclude>
                  </excludes>
                </filter>
              </filters>
              <finalName>${project.artifactId}-${project.version}</finalName>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
  </build>

  <dependencies>
    <!-- Hoodie -->
    <dependency>
      <groupId>org.apache.hudi</groupId>
      <artifactId>hudi-common</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>ch.qos.reload4j</groupId>
      <artifactId>reload4j</artifactId>
      <version>${reload4j.version}</version>
    </dependency>

    <!-- Fasterxml -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <!-- Httpcomponents -->
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>fluent-hc</artifactId>
    </dependency>

    <dependency>
      <groupId>io.javalin</groupId>
      <artifactId>javalin</artifactId>
      <version>${io.javalin.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>com.beust</groupId>
      <artifactId>jcommander</artifactId>
    </dependency>

    <dependency>
      <groupId>org.rocksdb</groupId>
      <artifactId>rocksdbjni</artifactId>
    </dependency>

    <!-- Hadoop -->
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-hdfs</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
      <!-- Need these exclusions to make sure JavaSparkContext can be setup. https://issues.apache.org/jira/browse/SPARK-1693 -->
      <exclusions>
        <exclusion>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.servlet.jsp</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.servlet.jsp</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-client</artifactId>
      <exclusions>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-util</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-webapp</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-http</artifactId>
      <version>${jetty.version}</version>
    </dependency>

    <!-- Hoodie - Test -->
    <dependency>
      <groupId>org.apache.hudi</groupId>
      <artifactId>hudi-common</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>
</project>
