<?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.7.0</version>
	<packaging>jar</packaging>

	<name>Cassandra JDBC Wrapper</name>
	<description>JDBC wrapper of the DataStax 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>
			<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>
    </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>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

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

        <!-- Versions for dependencies -->
        <checkstyle.version>9.3</checkstyle.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <datastax.java.driver.version>4.14.1</datastax.java.driver.version>
        <guava.version>18.0</guava.version>
        <!-- Versions for test dependencies -->
        <achilles-embedded.version>6.1.0</achilles-embedded.version>
        <hamcrest.version>2.2</hamcrest.version>
        <junit5.version>5.9.0</junit5.version>
        <junit-platform.version>1.9.0</junit-platform.version>
        <mockito.version>3.12.4</mockito.version>
        <!-- Versions for plugins -->
        <maven-checkstyle-plugin.version>3.2.0</maven-checkstyle-plugin.version>
        <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
        <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
        <maven-shade-plugin.version>3.4.0</maven-shade-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
	</properties>

	<dependencies>
        <dependency>
            <groupId>com.datastax.oss</groupId>
            <artifactId>java-driver-core</artifactId>
            <version>${datastax.java.driver.version}</version>
        </dependency>

        <!-- Include Guava following the removal of cassandra-all dependency -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>

        <!-- Apache Commons Lang 3 -->
        <dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.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>info.archinnov</groupId>
            <artifactId>achilles-embedded</artifactId>
            <version>${achilles-embedded.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>
                </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>
                </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>
	</profiles>
</project>
