<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2020 Dremio

    Licensed 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.projectnessie</groupId>
    <artifactId>nessie-versioned-tiered</artifactId>
    <version>0.9.2</version>
  </parent>

  <artifactId>nessie-versioned-tiered-dynamodb</artifactId>

  <name>Nessie - Versioned - Tiered - DynamoDB</name>

  <dependencies>
    <dependency>
      <groupId>org.projectnessie</groupId>
      <artifactId>nessie-versioned-spi</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.projectnessie</groupId>
      <artifactId>nessie-versioned-tiered-impl</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.projectnessie</groupId>
      <artifactId>nessie-versioned-tests</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.projectnessie</groupId>
      <artifactId>nessie-versioned-tiered-tests</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>DynamoDBLocal</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>dynamodb</artifactId>
      <exclusions>
        <exclusion>
          <groupId>software.amazon.awssdk</groupId>
          <artifactId>apache-client</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>netty-nio-client</artifactId>
    </dependency>
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>url-connection-client</artifactId>
    </dependency>
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>dynamodb-enhanced</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
    </dependency>
    <dependency>
      <groupId>org.immutables</groupId>
      <artifactId>value</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>io.micrometer</groupId>
      <artifactId>micrometer-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.opentracing</groupId>
      <artifactId>opentracing-api</artifactId>
    </dependency>
    <dependency>
      <groupId>io.opentracing</groupId>
      <artifactId>opentracing-util</artifactId>
    </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-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>dynamodb-local</id>
      <name>DynamoDB Local Release Repository</name>
      <url>${dynamodb-local.repository.url}</url>
    </repository>
  </repositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <aws.accessKeyId>xxx</aws.accessKeyId>
            <aws.secretAccessKey>xxx</aws.secretAccessKey>
            <sqlite4java.library.path>${project.build.directory}/native-libraries</sqlite4java.library.path>
          </systemPropertyVariables>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-native-libraries</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/native-libraries</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>false</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
              <includeTypes>dll,so,dylib</includeTypes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <activation>
        <os><family>unix</family></os>
      </activation>
      <id>linux</id>
      <dependencies>
        <dependency>
          <groupId>com.almworks.sqlite4java</groupId>
          <artifactId>libsqlite4java-linux-amd64</artifactId>
          <type>so</type>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <activation>
        <os><family>mac</family></os>
      </activation>
      <id>mac</id>
      <dependencies>
        <dependency>
          <groupId>com.almworks.sqlite4java</groupId>
          <artifactId>libsqlite4java-osx</artifactId>
          <type>dylib</type>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <activation>
        <os><family>windows</family></os>
      </activation>
      <id>windows</id>
      <dependencies>
        <dependency>
          <groupId>com.almworks.sqlite4java</groupId>
          <artifactId>sqlite4java-win32-x64</artifactId>
          <type>dll</type>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
