<!--

    The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
    (the "License"). You may not use this work except in compliance with the License, which is
    available at www.apache.org/licenses/LICENSE-2.0

    This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
    either express or implied, as more fully set forth in the License.

    See the NOTICE file distributed with this work for information regarding copyright ownership.

-->
<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>
    <artifactId>alluxio-core-server</artifactId>
    <groupId>org.alluxio</groupId>
    <version>2.9.4</version>
  </parent>
  <artifactId>alluxio-core-server-proxy</artifactId>
  <packaging>jar</packaging>
  <name>Alluxio Core - Server - Proxy</name>
  <description>Alluxio proxy service</description>

  <properties>
    <!-- The following paths need to be defined here as well as in the parent pom so that mvn can -->
    <!-- run properly from sub-project directories -->
    <build.path>${project.parent.parent.parent.basedir}/build</build.path>
  </properties>

  <dependencies>
    <!-- External dependencies -->
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-xml</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-servlet</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-servlet-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.inject</groupId>
      <artifactId>jersey-hk2</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.kerby</groupId>
      <artifactId>kerby-util</artifactId>
    </dependency>
    <!-- Required at runtime to decode json objects for rest API -->
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
    </dependency>

    <!-- Internal dependencies -->
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-common</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-client-fs</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-server-common</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- REST API documentation -->
      <plugin>
        <inherited>false</inherited>
        <groupId>com.github.kongchen</groupId>
        <artifactId>swagger-maven-plugin</artifactId>
        <configuration>
          <apiSources>
            <apiSource>
              <springmvc>false</springmvc>
              <schemes>http</schemes>
              <host>[Alluxio Proxy Hostname]</host>
              <basePath>/api/v1</basePath>
              <info>
                <version>v1</version>
                <title>Alluxio Proxy REST API Documentation</title>
                <!-- description must be left aligned after new line or markdown will misinterpret it -->
                <description>
                  The Alluxio Proxy acts as a REST gateway for clients to communicate with the Alluxio system. There are three different endpoints:

1. The Proxy endpoint gives general info about the proxy service.
1. The Paths endpoint provides a RESTful gateway to the Alluxio file system for metadata operations.
1. The Streams endpoint provides a RESTful gateway to the Alluxio file system for data operations.
                </description>
              </info>
              <locations>
                <location>alluxio.proxy.AlluxioProxyRestServiceHandler</location>
                <location>alluxio.proxy.PathsRestServiceHandler</location>
                <location>alluxio.proxy.StreamsRestServiceHandler</location>
              </locations>
              <templatePath>${project.parent.parent.parent.basedir}/templates/strapdown.html.hbs</templatePath>
              <outputPath>${project.parent.parent.parent.basedir}/generated/proxy/index.html</outputPath>
              <swaggerDirectory>${project.parent.parent.parent.basedir}/generated/proxy/swagger-ui</swaggerDirectory>
            </apiSource>
          </apiSources>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
