<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <!-- Parent -->
  <parent>
    <groupId>io.stargate</groupId>
    <artifactId>stargate</artifactId>
    <version>2.0.51</version>
  </parent>
  <!-- Artifact properties -->
  <groupId>io.stargate.web</groupId>
  <artifactId>restapi</artifactId>
  <name>Stargate - Coordinator - REST API (deprecated)</name>
  <properties>
    <osgi.bundle.version>${project.version}</osgi.bundle.version>
  </properties>
  <dependencies>
    <!-- Stargate component dependencies -->
    <dependency>
      <groupId>io.stargate.core</groupId>
      <artifactId>core</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.stargate.db</groupId>
      <artifactId>persistence-api</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.stargate.auth</groupId>
      <artifactId>authnz</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.stargate.metrics</groupId>
      <artifactId>metrics-jersey</artifactId>
      <version>${project.version}</version>
    </dependency>
    <!-- 3rd party dependencies -->
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-healthchecks</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-jersey</artifactId>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-core</artifactId>
    </dependency>
    <!-- Since restapi serializes Java 8 date/time values, we must use
         JSR-310 module. Version provided by parent.
      -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
    </dependency>
    <dependency>
      <groupId>com.github.java-json-tools</groupId>
      <artifactId>json-schema-validator</artifactId>
      <version>2.2.14</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-util</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-http</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-servlet</artifactId>
    </dependency>
    <dependency>
      <groupId>com.datastax.oss</groupId>
      <artifactId>java-driver-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>com.datastax.oss</groupId>
      <artifactId>java-driver-shaded-guava</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-jersey2-jaxrs</artifactId>
      <version>${swagger-jersey2-jaxrs.version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.jsurfer</groupId>
      <artifactId>jsurfer-jackson</artifactId>
      <version>1.6.2</version>
    </dependency>
    <dependency>
      <groupId>com.github.ben-manes.caffeine</groupId>
      <artifactId>caffeine</artifactId>
    </dependency>
    <dependency>
      <groupId>com.bpodgursky</groupId>
      <artifactId>jbool_expressions</artifactId>
    </dependency>
    <dependency>
      <groupId>io.reactivex.rxjava3</groupId>
      <artifactId>rxjava</artifactId>
      <version>3.0.12</version>
    </dependency>
    <dependency>
      <groupId>com.github.akarnokd</groupId>
      <artifactId>rxjava3-extensions</artifactId>
      <version>3.0.1</version>
    </dependency>
    <!-- Test dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-testing</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <!-- Download swagger-ui resources jar -->
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars</groupId>
                  <artifactId>swagger-ui</artifactId>
                  <version>${swagger-ui.version}</version>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}/swagger-ui</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Copy swagger-ui resources to target resources -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/classes/swagger-ui</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <unpackBundle>true</unpackBundle>
          <instructions>
            <Bundle-Name>RestAPI</Bundle-Name>
            <Bundle-Description>REST API for Stargate project</Bundle-Description>
            <Bundle-SymbolicName>io.stargate.web</Bundle-SymbolicName>
            <Bundle-Activator>io.stargate.web.impl.RestApiActivator</Bundle-Activator>
            <Embed-Transitive>true</Embed-Transitive>
            <Import-Package><![CDATA[
                            org.slf4j,
                            org.slf4j.helpers,
                            org.slf4j.spi,
                            org.osgi.framework,
                            io.stargate.auth,
                            io.stargate.auth.*,
                            io.stargate.core.*,
                            io.stargate.db,
                            io.stargate.db.*,
                            org.apache.cassandra.stargate,
                            org.apache.cassandra.stargate.*,
                            org.javatuples,
                            com.codahale.metrics,
                            com.codahale.metrics.*,
                            io.micrometer.core.*,
                            com.datastax.oss.driver.api.*,
                            com.datastax.oss.driver.shaded.guava.common.*,
                        ]]></Import-Package>
            <Export-Package>!*</Export-Package>
            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
          </instructions>
          <buildDirectory>${project.basedir}/../stargate-lib</buildDirectory>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
            <manifestEntries>
              <x-Stargate-Health-Checkers>restapi</x-Stargate-Health-Checkers>
            </manifestEntries>
          </archive>
          <outputDirectory>${project.basedir}/../stargate-lib</outputDirectory>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
