<?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">
    <modelVersion>4.0.0</modelVersion>

	<groupId>com.ing.data</groupId>
	<artifactId>cassandra-jdbc-wrapper</artifactId>
    <version>4.16.0</version>
	<packaging>jar</packaging>

    <name>Cassandra JDBC Wrapper</name>
    <description>JDBC wrapper of the Java Driver for Apache Cassandra®.</description>
    <url>https://github.com/ing-bank/cassandra-jdbc-wrapper</url>
    <inceptionYear>2020</inceptionYear>

    <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>

    <organization>
        <name>ING Bank</name>
        <url>https://www.ing.com</url>
    </organization>

    <developers>
        <developer>
            <id>maximevw</id>
            <url>https://github.com/maximevw</url>
            <name>Maxime Wiewiora</name>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <contributors>
        <!-- Thanks to @adejanovski, developer of the original project forked as base for this one. -->
        <contributor>
            <name>Alexander Dejanovski</name>
            <url>https://github.com/adejanovski</url>
            <roles>
                <role>developer</role>
            </roles>
        </contributor>
        <contributor>
            <name>Madhavan Sridharan</name>
            <url>https://github.com/msmygit</url>
            <roles>
                <role>developer</role>
            </roles>
        </contributor>
        <contributor>
            <name>Marius Jokubauskas</name>
            <url>https://github.com/mjok</url>
            <roles>
                <role>developer</role>
            </roles>
        </contributor>
        <contributor>
            <name>Sualeh Fatehi</name>
            <url>https://github.com/sualeh</url>
            <roles>
                <role>developer</role>
            </roles>
        </contributor>
        <contributor>
            <name>Cedrick Lunven</name>
            <url>https://github.com/clun</url>
            <roles>
                <role>developer</role>
            </roles>
        </contributor>
        <contributor>
            <name>Stefano Fornari</name>
            <url>https://github.com/stefanofornari</url>
            <roles>
                <role>developer</role>
            </roles>
        </contributor>
        <contributor>
            <name>Liudmila Kornilova</name>
            <url>https://github.com/kornilova203</url>
            <roles>
                <role>developer</role>
            </roles>
        </contributor>
        <contributor>
            <name>Lik Dan</name>
            <url>https://github.com/LikDan</url>
            <roles>
                <role>developer</role>
            </roles>
        </contributor>
    </contributors>

    <scm>
        <connection>scm:git:https://github.com:ing-bank/cassandra-jdbc-wrapper.git</connection>
        <developerConnection>scm:git:git@github.com:ing-bank/cassandra-jdbc-wrapper.git</developerConnection>
        <url>https://github.com/ing-bank/cassandra-jdbc-wrapper</url>
    </scm>

    <properties>
        <encoding>UTF-8</encoding>
        <java.version>1.8</java.version>

        <!-- Versions for dependencies -->
        <astra-sdk.version>1.2.9</astra-sdk.version>
        <aws-secretsmanager.version>2.32.18</aws-secretsmanager.version>
        <aws-sigv4-auth-cassandra.version>4.0.9</aws-sigv4-auth-cassandra.version>
        <checkstyle.version>9.3</checkstyle.version>
        <caffeine.version>2.9.3</caffeine.version>
        <cassandra-driver-krb5.version>3.0.0</cassandra-driver-krb5.version>
        <commons-collections.version>4.5.0</commons-collections.version>
        <commons-io.version>2.20.0</commons-io.version>
        <commons-lang3.version>3.18.0</commons-lang3.version>
        <java.driver.version>4.19.0</java.driver.version>
        <jackson.version>2.19.2</jackson.version>
        <javax-jsr305.version>3.0.2</javax-jsr305.version>
        <opencsv.version>5.12.0</opencsv.version>
        <semver4j.version>5.6.0</semver4j.version>
        <!-- Versions for test dependencies -->
        <approvaltests.version>25.0.23</approvaltests.version>
        <dotenv.version>2.3.2</dotenv.version>
        <hamcrest.version>2.2</hamcrest.version>
        <junit5.version>5.13.4</junit5.version>
        <junit-platform.version>1.13.4</junit-platform.version>
        <lombok.version>1.18.38</lombok.version>
        <mockito.version>3.12.4</mockito.version>
        <slf4j.version>1.7.36</slf4j.version>
        <testcontainers.version>1.21.3</testcontainers.version>
        <!-- Versions for plugins -->
        <central-publishing-plugin.version>0.8.0</central-publishing-plugin.version>
        <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
        <maven-clean-plugin.version>3.5.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
        <maven-enforcer-plugin.version>3.6.1</maven-enforcer-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
        <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
        <maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>java-driver-core</artifactId>
            <version>${java.driver.version}</version>
        </dependency>

        <!-- Apache Commons Lang 3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>

        <!-- Apache Commons IO -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>

        <!-- Apache Commons Collections -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons-collections.version}</version>
        </dependency>

        <!-- Caffeine caching -->
        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
            <version>${caffeine.version}</version>
        </dependency>

        <!-- Jackson -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <!-- Semver for operations on versions -->
        <dependency>
            <groupId>org.semver4j</groupId>
            <artifactId>semver4j</artifactId>
            <version>${semver4j.version}</version>
        </dependency>

        <!-- Kerberos Auth provider support -->
        <dependency>
            <groupId>com.instaclustr</groupId>
            <artifactId>cassandra-driver-kerberos</artifactId>
            <version>${cassandra-driver-krb5.version}</version>
        </dependency>

        <!-- Javax annotations (JSR-305) -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>${javax-jsr305.version}</version>
        </dependency>

        <!-- AWS Auth provider support -->
        <dependency>
            <groupId>software.aws.mcs</groupId>
            <artifactId>aws-sigv4-auth-cassandra-java-driver-plugin</artifactId>
            <version>${aws-sigv4-auth-cassandra.version}</version>
            <exclusions>
                <!-- Dependencies already provided through import of AWS Secret manager below, exclude them here to
                 ensure the Amazon Secrets manager client works with the appropriate dependencies versions. -->
                <exclusion>
                    <artifactId>profiles</artifactId>
                    <groupId>software.amazon.awssdk</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>auth</artifactId>
                    <groupId>software.amazon.awssdk</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- AWS Secrets manager -->
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>secretsmanager</artifactId>
            <version>${aws-secretsmanager.version}</version>
        </dependency>

        <!-- Astra SDK for integration with AstraDB -->
        <dependency>
            <groupId>com.datastax.astra</groupId>
            <artifactId>astra-sdk-devops</artifactId>
            <version>${astra-sdk.version}</version>
        </dependency>

        <!-- OpenCSV for implementation of COPY special command -->
        <dependency>
            <groupId>com.opencsv</groupId>
            <artifactId>opencsv</artifactId>
            <version>${opencsv.version}</version>
        </dependency>

        <!-- Unit tests libraries -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit5.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit5.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit5.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-runner</artifactId>
            <version>${junit-platform.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-commons</artifactId>
            <version>${junit-platform.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Embedded Cassandra for unit tests -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>cassandra</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- LocalStack containers for tests using Amazon Secrets manager -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>localstack</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Handy to build the CQL queries -->
        <dependency>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>java-driver-query-builder</artifactId>
            <version>${java.driver.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Logging for tests -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Approval tests -->
        <dependency>
            <groupId>com.approvaltests</groupId>
            <artifactId>approvaltests</artifactId>
            <version>${approvaltests.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Lombok (used only for some tests) -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Dotenv for tests only running locally (integration with DBaaS) -->
        <dependency>
            <groupId>io.github.cdimascio</groupId>
            <artifactId>dotenv-java</artifactId>
            <version>${dotenv.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <!-- Configuration for resources filtering -->
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <!-- Cleaning -->
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>${maven-clean-plugin.version}</version>
            </plugin>

            <!-- Resources management -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
                <configuration>
                    <encoding>${encoding}</encoding>
                    <propertiesEncoding>${encoding}</propertiesEncoding>
                </configuration>
            </plugin>

            <!-- Enforcer -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banDuplicatePomDependencyVersions/>
                                <reactorModuleConvergence/>
                                <requireReleaseDeps/>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Compilation -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <encoding>${encoding}</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <parameters>true</parameters>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>

            <!-- Tests running -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </plugin>

            <!-- Checkstyle -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <configuration>
                    <configLocation>checkstyle-config.xml</configLocation>
                    <consoleOutput>true</consoleOutput>
                </configuration>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <!-- Enforce the version of Checkstyle used by the plugin. -->
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <!-- Specific building profiles -->
    <profiles>
        <!-- 'release' profile is used for releasing of stable versions only. -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Generate sources jar -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Generate Javadoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                    </plugin>

                    <!-- GPG artifacts signing -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- Prevent `gpg` from using pinentry programs -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>

                    <!-- Publishing on Maven Central -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${central-publishing-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <deploymentName>Cassandra JDBC Wrapper deployment</deploymentName>
                            <publishingServerId>central</publishingServerId>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- 'bundle' profile creates jar including dependencies and should be used for bundling of stable versions
        only. -->
        <profile>
            <id>bundle</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>${maven-shade-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <createSourcesJar>false</createSourcesJar>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <finalName>${project.artifactId}-${project.version}-bundle</finalName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- 'disableDseTests' excludes integration tests using DataStax Enterprise server. This can be handy if
         these specific tests failed for some reason in a local environment. -->
        <profile>
            <id>disableDseTests</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                        <configuration>
                            <excludes>
                                <exclude>*DseContainerTest.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
