<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>scylla-cdc</artifactId>
    <groupId>com.scylladb</groupId>
    <version>1.3.6</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>scylla-cdc-driver3</artifactId>
  <name>Java Library for Scylla CDC - driver 3.x</name>
  <description>A CQL backend for scylla-cdc-java using Scylla Java Driver 3.x.</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <excludes>
                  <exclude>com.google.flogger</exclude>
                  <exclude>org.slf4j</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>com.datastax.</pattern>
                  <shadedPattern>shaded.com.scylladb.cdc.driver3.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.netty.</pattern>
                  <shadedPattern>shaded.com.scylladb.cdc.driver3.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.</pattern>
                  <shadedPattern>shaded.com.scylladb.cdc.driver3.</shadedPattern>
                  <excludes>
                    <exclude>com.google.common.flogger.*</exclude>
                  </excludes>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.34.1</version>
        <executions>
          <execution>
            <id>start</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>build</goal>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>stop</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <imagePullPolicy>Always</imagePullPolicy>
          <images>
            <image>
              <alias>scylla</alias>
              <name>scylladb/scylla:${scylla.docker.version}</name>
              <run>
                <ports>
                  <port>${scylla.docker.port}:9042</port>
                </ports>
                <wait>
                  <log>init - serving</log>
                  <time>90000</time>
                </wait>
                <cpuSet>0</cpuSet>
              </run>
            </image>
          </images>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.5.2</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <systemPropertyVariables>
            <scylla.docker.hostname>${docker.host.address}</scylla.docker.hostname>
            <scylla.docker.port>${scylla.docker.port}</scylla.docker.port>
            <scylla.docker.version>${scylla.docker.version}</scylla.docker.version>
          </systemPropertyVariables>
          <trimStackTrace>false</trimStackTrace>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>skip-integration-tests</id>
      <properties>
        <docker.skip>true</docker.skip>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>com.google.flogger</groupId>
      <artifactId>flogger</artifactId>
      <version>0.8</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.flogger</groupId>
      <artifactId>flogger-system-backend</artifactId>
      <version>0.8</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.12.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-params</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-engine</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>4.3.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <scylla.docker.port>4301</scylla.docker.port>
    <docker.skip>false</docker.skip>
    <scylla.driver.version>3.11.5.7</scylla.driver.version>
    <scylla.docker.version>latest</scylla.docker.version>
    <log4j.version>2.17.1</log4j.version>
  </properties>
</project>
