<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.scylladb</groupId>
    <artifactId>scylla-cdc</artifactId>
    <version>1.3.6</version>
    <packaging>pom</packaging>
    <name>Java Library for Scylla CDC</name>
    <description>A library for reading the Scylla CDC log.</description>
    <url>https://github.com/scylladb/scylla-cdc-java</url>
    <inceptionYear>2020</inceptionYear>
    <modules>
        <module>scylla-cdc-base</module>
        <module>scylla-cdc-lib</module>
        <module>scylla-cdc-driver3</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <flogger.version>0.8</flogger.version>
        <publish.dry.run>false</publish.dry.run>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>5.12.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.google.flogger</groupId>
                <artifactId>flogger</artifactId>
                <version>${flogger.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.flogger</groupId>
                <artifactId>flogger-system-backend</artifactId>
                <version>${flogger.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.12.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>4.3.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.7.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.2</version>
                    <configuration>
                        <systemPropertyVariables>
                            <property>
                                <name>java.util.logging.config.file</name>
                                <value>src/test/resources/logging.properties</value>
                            </property>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <tagNameFormat>scylla-cdc-@{project.version}</tagNameFormat>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <releaseProfiles>release</releaseProfiles>
                        <!-- useReleaseProfile>false</useReleaseProfile>
                        <goals>deploy</goals-->
                        <localCheckout>true</localCheckout>
                        <pushChanges>false</pushChanges>
                        <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-provider-gitexe</artifactId>
                            <version>1.9.5</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.7.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <skipPublishing>${publish.dry.run}</skipPublishing>
                    <waitForPublishCompletion>true</waitForPublishCompletion>
                    <waitUntil>published</waitUntil>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.7</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.1.4</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.4</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>
        </plugins>
    </build>

    <!--
    Profile activated when releasing. See:
    http://central.sonatype.org/pages/apache-maven.html
    -->
    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:https://github.com/scylladb/scylla-cdc-java</connection>
        <developerConnection>scm:git:https://github.com/scylladb/scylla-cdc-java</developerConnection>
        <url>https://github.com/scylladb/scylla-cdc-java</url>
        <tag>scylla-cdc-1.3.6</tag>
    </scm>
    
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>Apache License Version 2.0</comments>
        </license>
    </licenses>

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <url>https://central.sonatype.com/repository/maven-snapshots</url>
        </snapshotRepository>
        <repository>
            <id>central</id>
            <url>https://central.sonatype.com/repository/maven-releases</url>
        </repository>
    </distributionManagement>

    <developers>
        <developer>
            <name>Various</name>
            <organization>ScyllaDB</organization>
        </developer>
    </developers>
</project>
