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

    <groupId>com.playtika.nosql</groupId>
    <artifactId>batch-updater-parent</artifactId>
    <version>0.0.22</version>
    <packaging>pom</packaging>

    <modules>
        <module>batch-updater</module>
        <module>reactor-batch-updater</module>
        <module>aerospike-batch-updater</module>
        <module>aerospike-reactor-batch-updater</module>
        <module>aerospike-container</module>
    </modules>

    <name>nosql-batch-updater</name>
    <description>Batch updates on NoSql DBs</description>
    <url>https://github.com/PlaytikaOSS/nosql-batch-updater</url>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/PlaytikaOSS/nosql-batch-updater/issues</url>
    </issueManagement>

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

    <scm>
        <url>https://svn.apache.org/viewvc/maven</url>
        <connection>scm:git:git://github.com/Playtika/nosql-batch-updater.git</connection>
        <developerConnection>scm:git:git@github.com:Playtika/nosql-batch-updater.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <id>kptfh</id>
            <name>Sergii Karpenko</name>
            <email>sergey.karpenko@gmail.com</email>
        </developer>
    </developers>

    <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>
        <java.version>17</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <aerospike-client.version>6.2.0</aerospike-client.version>
        <aerospike-reactor-client.version>6.1.2</aerospike-reactor-client.version>
        <slf4j.version>1.7.25</slf4j.version>

        <reactor-core.version>3.2.12.RELEASE</reactor-core.version>

        <!-- Tests -->
        <testcontainers.version>1.19.1</testcontainers.version>
        <junit.version>4.12</junit.version>
        <assertj.version>3.9.0</assertj.version>
        <blockhound.version>1.0.8.RELEASE</blockhound.version>

        <log4j.version>2.11.1</log4j.version>
        <awaitility.version>3.1.6</awaitility.version>

        <!-- Plugins -->
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>3.2.1</maven-surefire-plugin.version>
        <maven-source-plugin.version>3.3.0</maven-source-plugin.version>
        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
        <maven.javadoc.plugin.version>3.6.0</maven.javadoc.plugin.version>
        <maven.source.plugin.version>3.3.0</maven.source.plugin.version>
        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>

        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
        <gitflow-incremental-builder.version>4.5.1</gitflow-incremental-builder.version>

        <!-- GPG -->
        <gpg.keyname>3EEF24C7</gpg.keyname>
        <gpg.defaultKeyring>false</gpg.defaultKeyring>
        <gpg.useagent>true</gpg.useagent>
        <gpg.lockMode>never</gpg.lockMode>
    </properties>


    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>io.projectreactor</groupId>
                <artifactId>reactor-core</artifactId>
                <version>${reactor-core.version}</version>
            </dependency>

            <dependency>
                <groupId>com.aerospike</groupId>
                <artifactId>aerospike-client</artifactId>
                <version>${aerospike-client.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.aerospike</groupId>
                <artifactId>aerospike-reactor-client</artifactId>
                <version>${aerospike-reactor-client.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.playtika.nosql</groupId>
                <artifactId>batch-updater</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.playtika.nosql</groupId>
                <artifactId>aerospike-batch-updater</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.playtika.nosql</groupId>
                <artifactId>reactor-batch-updater</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <!--Test-->

            <dependency>
                <groupId>com.playtika.nosql</groupId>
                <artifactId>batch-updater</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.playtika.nosql</groupId>
                <artifactId>aerospike-batch-updater</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.playtika.nosql</groupId>
                <artifactId>reactor-batch-updater</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.playtika.nosql</groupId>
                <artifactId>aerospike-container</artifactId>
                <version>${project.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>${testcontainers.version}</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
                <scope>test</scope>
            </dependency>

            <!--Needed for tracking blocking calls in reactive application https://github.com/reactor/BlockHound -->
            <dependency>
                <groupId>io.projectreactor.tools</groupId>
                <artifactId>blockhound</artifactId>
                <version>${blockhound.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                    </configuration>
                </plugin>

                <!-- Run tests -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <argLine>-XX:+AllowRedefinitionToAddDeleteMethods</argLine>
                    </configuration>
                </plugin>

                <!-- Attach sources to release -->
                <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>

                <!-- Attach Javadoc to release -->
                <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>
                        <source>17</source>
                        <doclint>none</doclint>
                        <failOnError>false</failOnError>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>io.github.gitflow-incremental-builder</groupId>
                    <artifactId>gitflow-incremental-builder</artifactId>
                    <version>${gitflow-incremental-builder.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <disableIfBranchMatches>develop</disableIfBranchMatches>
                        <fetchReferenceBranch>true</fetchReferenceBranch>
                        <referenceBranch>refs/remotes/origin/develop</referenceBranch>
                        <buildUpstream>always</buildUpstream>
                        <skipTestsForUpstreamModules>true</skipTestsForUpstreamModules>
                        <buildUpstreamMode>impacted</buildUpstreamMode>
                        <skipIfPathMatches>\.github[/\\].*|\.mvn[/\\].*|mvnw.*</skipIfPathMatches>
                        <!-- Ignores Readme changes in parent or any submodule-->
                        <excludePathsMatching>(.*[/\\])?README.adoc</excludePathsMatching>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>io.github.gitflow-incremental-builder</groupId>
                <artifactId>gitflow-incremental-builder</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>ossrh</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <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>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
