<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>
  <groupId>com.feedzai</groupId>
  <artifactId>pdb</artifactId>
  <version>2.8.23</version>
  <name>pdb</name>
  <url>https://github.com/feedzai/pdb</url>
  <organization>
    <name>Feedzai</name>
    <url>http://www.feedzai.com</url>
  </organization>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>rpvilao</id>
      <name>Rui Vilao</name>
      <email>rui.vilao@feedzai.com</email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git@github.com:feedzai/pdb.git</connection>
    <developerConnection>scm:git:git@github.com:feedzai/pdb.git</developerConnection>
    <tag>2.8.23</tag>
    <url>git@github.com:feedzai/pdb.git</url>
  </scm>
  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <jmockit.version>1.49</jmockit.version>
    <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
    <maven-source-plugin.version>3.3.0</maven-source-plugin.version>
    <project.source>1.8</project.source>
    <default.test.cmdArgs>-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
            -Djdk.attach.allowAttachSelf</default.test.cmdArgs>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.49</version>
      </dependency>
      <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>42.6.0</version>
      </dependency>
      <dependency>
        <groupId>com.oracle.database.jdbc</groupId>
        <artifactId>ojdbc8</artifactId>
        <version>23.3.0.23.09</version>
      </dependency>
      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>2.2.224</version>
      </dependency>
      <dependency>
        <groupId>com.ibm.db2</groupId>
        <artifactId>jcc</artifactId>
        <version>11.5.8.0</version>
      </dependency>
      <dependency>
        <groupId>com.microsoft.sqlserver</groupId>
        <artifactId>mssql-jdbc</artifactId>
        <version>12.4.1.jre8</version>
      </dependency>
      <dependency>
        <groupId>org.jmockit</groupId>
        <artifactId>jmockit</artifactId>
        <version>${jmockit.version}</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.24.2</version>
      </dependency>
      <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <version>4.2.0</version>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>25.1-jre</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.12</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.36</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.13.0</version>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.16.0</version>
      </dependency>
      <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>5.0.1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-pool2</artifactId>
        <version>2.12.0</version>
      </dependency>
      <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>1.9.4</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.database.jdbc</groupId>
      <artifactId>ojdbc8</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>mssql-jdbc</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.ibm.db2</groupId>
      <artifactId>jcc</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jmockit</groupId>
      <artifactId>jmockit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</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>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-pool2</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.0.1</version>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>4.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.11.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.1.2</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.6.0</version>
          <configuration>
            <tags>
              <tag>
                <name>apiNote</name>
                <placement>a</placement>
                <head>API Note:</head>
              </tag>
              <tag>
                <name>implSpec</name>
                <placement>a</placement>
                <head>Implementation Requirements:</head>
              </tag>
              <tag>
                <name>implNote</name>
                <placement>a</placement>
                <head>Implementation Note:</head>
              </tag>
            </tags>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>0.40.2</version>
          <executions>
            <execution>
              <id>start</id>
              <phase>test-compile</phase>
              <goals>
                <goal>stop</goal>
                <goal>start</goal>
              </goals>
            </execution>
            <execution>
              <id>stop</id>
              <phase>test</phase>
              <goals>
                <goal>stop</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <verbose>true</verbose>
            <useColor>true</useColor>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${project.source}</source>
          <target>${project.source}</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <failIfNoTests>false</failIfNoTests>
          <systemProperties>
            <instances>h2</instances>
          </systemProperties>
          <argLine>${default.test.cmdArgs}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <includes>
            <include>src/main/**/*.java</include>
            <include>src/test/**/*.java</include>
          </includes>
          <useDefaultExcludes>true</useDefaultExcludes>
          <properties>
            <year>2021</year>
          </properties>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
          </mapping>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <localCheckout>true</localCheckout>
          <pushChanges>false</pushChanges>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>deploy</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>deploy</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doclint>none</doclint>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-gpg-plugin</artifactId>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>deploy</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <executions>
          <execution>
            <id>deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>h2remote</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <instances>h2remote</instances>
              </systemProperties>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>test-compile</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>java</executable>
              <classpathScope>test</classpathScope>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>org.h2.tools.Server</argument>
                <argument>-tcp</argument>
                <argument>-baseDir</argument>
                <argument>${project.build.testOutputDirectory}/pdb-h2-remote</argument>
                <argument>-ifNotExists</argument>
              </arguments>
              <async>true</async>
              <asyncDestroyOnShutdown>true</asyncDestroyOnShutdown>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>h2v2</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <instances>h2v2</instances>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>h2v2remote</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <instances>h2v2remote</instances>
              </systemProperties>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>test-compile</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>java</executable>
              <classpathScope>test</classpathScope>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>org.h2.tools.Server</argument>
                <argument>-tcp</argument>
                <argument>-tcpPort</argument>
                <argument>9093</argument>
                <argument>-baseDir</argument>
                <argument>${project.build.testOutputDirectory}/pdb-h2v2-remote</argument>
                <argument>-ifNotExists</argument>
              </arguments>
              <async>true</async>
              <asyncDestroyOnShutdown>true</asyncDestroyOnShutdown>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>mysql</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <instances>mysql</instances>
              </systemProperties>
            </configuration>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <configuration>
              <images>
                <image>
                  <name>${image.mysql}</name>
                  <alias>pdb-mysql</alias>
                  <run>
                    <namingStrategy>alias</namingStrategy>
                    <hostname>pdb-mysql</hostname>
                    <ports>
                      <port>3306:3306</port>
                    </ports>
                    <env>
                      <MYSQL_ROOT_PASSWORD>AaBb12.#</MYSQL_ROOT_PASSWORD>
                    </env>
                    <cmd>--character-set-server=utf8mb4 --collation-server=utf8mb4_bin --max-allowed-packet=32000000 --innodb-log-file-size=160000000</cmd>
                    <wait>
                      <time>40000</time>
                      <log>MySQL init process done. Ready for start up.</log>
                    </wait>
                  </run>
                </image>
              </images>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <image.mysql>mysql:5.7.22</image.mysql>
      </properties>
    </profile>
    <profile>
      <id>sqlserver</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <instances>sqlserver</instances>
              </systemProperties>
            </configuration>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <configuration>
              <images>
                <image>
                  <name>${image.sqlserver}</name>
                  <alias>pdb-sqlserver</alias>
                  <run>
                    <namingStrategy>alias</namingStrategy>
                    <hostname>pdb-sqlserver</hostname>
                    <ports>
                      <port>1433:1433</port>
                    </ports>
                    <env>
                      <ACCEPT_EULA>Y</ACCEPT_EULA>
                      <SA_PASSWORD>AaBb12.#</SA_PASSWORD>
                    </env>
                    <wait>
                      <time>40000</time>
                      <log>Service Broker manager has started</log>
                      <exec>
                        <postStart>/opt/mssql-tools/bin/sqlcmd -l 45 -U sa -P AaBb12.# -Q CREATE\ DATABASE\ pdb\ COLLATE\ Latin1_General_100_CS_AS_KS_WS_SC_UTF8;\ ALTER\ DATABASE\ pdb\ SET\ READ_COMMITTED_SNAPSHOT\ ON;\ ALTER\ DATABASE\ pdb\ SET\ ALLOW_SNAPSHOT_ISOLATION\ ON</postStart>
                      </exec>
                    </wait>
                  </run>
                </image>
              </images>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <image.sqlserver>mcr.microsoft.com/mssql/server:2019-CU15-ubuntu-20.04</image.sqlserver>
      </properties>
    </profile>
    <profile>
      <id>postgresql</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <instances>postgresql</instances>
              </systemProperties>
            </configuration>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <configuration>
              <images>
                <image>
                  <name>${image.postgresql}</name>
                  <alias>pdb-postgresql</alias>
                  <run>
                    <namingStrategy>alias</namingStrategy>
                    <hostname>pdb-postgresql</hostname>
                    <ports>
                      <port>5432:5432</port>
                    </ports>
                    <env>
                      <POSTGRES_PASSWORD>AaBb12.#</POSTGRES_PASSWORD>
                    </env>
                    <wait>
                      <time>40000</time>
                      <log>PostgreSQL init process complete; ready for start up</log>
                    </wait>
                  </run>
                </image>
              </images>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <image.postgresql>postgres:12.3</image.postgresql>
      </properties>
    </profile>
    <profile>
      <id>cockroach</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <instances>cockroach</instances>
              </systemProperties>
              <excludedGroups>com.feedzai.commons.sql.abstraction.engine.impl.cockroach.SkipTestCockroachDB</excludedGroups>
            </configuration>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <configuration>
              <images>
                <image>
                  <name>${image.cockroach}</name>
                  <alias>pdb-cockroach</alias>
                  <run>
                    <namingStrategy>alias</namingStrategy>
                    <hostname>pdb-cockroach</hostname>
                    <ports>
                      <port>8080:8080</port>
                      <port>26257:26257</port>
                    </ports>
                    <cmd>start-single-node --insecure</cmd>
                    <wait>
                      <time>40000</time>
                      <log>CockroachDB node starting</log>
                    </wait>
                  </run>
                </image>
              </images>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <image.cockroach>cockroachdb/cockroach:v22.2.7</image.cockroach>
      </properties>
    </profile>
    <profile>
      <id>oracle</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>${default.test.cmdArgs} -Doracle.jdbc.timezoneAsRegion=false</argLine>
              <systemProperties>
                <instances>oracle</instances>
              </systemProperties>
            </configuration>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <configuration>
              <images>
                <image>
                  <name>${image.oracle}</name>
                  <alias>pdb-oracle</alias>
                  <run>
                    <namingStrategy>alias</namingStrategy>
                    <hostname>pdb-oracle</hostname>
                    <ports>
                      <port>1521:1521</port>
                    </ports>
                    <wait>
                      <time>360000</time>
                      <log>Disconnected from Oracle Database 11g</log>
                    </wait>
                  </run>
                </image>
              </images>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <image.oracle>iatebes/oracle_11g:latest</image.oracle>
      </properties>
    </profile>
    <profile>
      <id>db2</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <instances>db2</instances>
              </systemProperties>
            </configuration>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <configuration>
              <images>
                <image>
                  <name>${image.db2}</name>
                  <alias>pdb-db2</alias>
                  <run>
                    <namingStrategy>alias</namingStrategy>
                    <hostname>pdb-db2</hostname>
                    <ports>
                      <port>50000:50000</port>
                    </ports>
                    <capAdd>IPC_LOCK,IPC_OWNER</capAdd>
                    <env>
                      <LICENSE>accept</LICENSE>
                      <DB2INST1_PASSWORD>AaBb12.#</DB2INST1_PASSWORD>
                      <DBNAME>testdb</DBNAME>
                      <ARCHIVE_LOGS>false</ARCHIVE_LOGS>
                      <AUTOCONFIG>false</AUTOCONFIG>
                      <SAMPLEDB>false</SAMPLEDB>
                      <HADR_ENABLED>false</HADR_ENABLED>
                    </env>
                    <wait>
                      <time>360000</time>
                      <log>Setup has completed.</log>
                    </wait>
                  </run>
                </image>
              </images>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <image.db2>ibmcom/db2:11.5.7.0a</image.db2>
      </properties>
    </profile>
    <profile>
      <id>java-11</id>
      <activation>
        <jdk>11</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <release>${project.source}</release>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <project.source>11</project.source>
      </properties>
    </profile>
    <profile>
      <id>java-17</id>
      <activation>
        <jdk>17</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <release>${project.source}</release>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <project.source>17</project.source>
      </properties>
    </profile>
  </profiles>
</project>
