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

    <groupId>io.tarantool</groupId>
    <artifactId>testcontainers-java-tarantool</artifactId>
    <packaging>jar</packaging>
    <version>v1.4.1</version>

    <name>TestContainers for Tarantool</name>
    <description>Dockerized Tarantool and Tarantool Cartridge containers for testing under Testcontainers.</description>
    <url>https://github.com/tarantool/cartridge-java-testcontainers</url>

    <licenses>
        <license>
            <name>The BSD License</name>
            <url>https://opensource.org/licenses/BSD-3-Clause</url>
        </license>
    </licenses>

    <organization>
        <name>Tarantool</name>
        <url>https://tarantool.io/</url>
    </organization>

    <developers>
        <developer>
            <id>akudiyar</id>
            <name>Alexey Kuzin</name>
            <email>akudiyar@gmail.com</email>
            <organization>Tarantool</organization>
            <organizationUrl>https://tarantool.io/</organizationUrl>
        </developer>
        <developer>
            <id>ArtDub</id>
            <name>Artyom Dubinin</name>
            <email>rusartdub@gmail.com</email>
            <organization>Tarantool</organization>
            <organizationUrl>https://tarantool.io/</organizationUrl>
        </developer>
    </developers>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/tarantool/testcontainers-java-tarantool/issues/</url>
    </issueManagement>

    <scm>
        <connection>scm:git:git@github.com:tarantool/testcontainers-java-tarantool.git</connection>
        <developerConnection>scm:git:git@github.com:tarantool/testcontainers-java-tarantool.git</developerConnection>
        <url>http://github.com/tarantool/testcontainers-java-tarantool/tree/master</url>
        <tag>v1.4.1</tag>
    </scm>

    <properties>
        <testcontainers.version>1.21.3</testcontainers.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <logging.config>${project.basedir}/src/test/resources/logback-test.xml</logging.config>
        <logging.logLevel>debug</logging.logLevel>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>2.18.4</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.17</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <version>${testcontainers.version}</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5</artifactId>
            <version>5.5.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.3.15</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.13.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>${project.basedir}/src/main/resources</directory>
            </testResource>
            <testResource>
                <directory>${project.basedir}/src/test/resources</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.3.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <configuration>
                    <detectOfflineLinks>false</detectOfflineLinks>
                    <breakiterator>true</breakiterator>
                    <version>false</version>
                    <author>false</author>
                    <keywords>true</keywords>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                    <indentSize>4</indentSize>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.12</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <append>true</append>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <fileSets>
                        <fileSet>
                            <directory>${project.build.directory}</directory>
                            <includes>
                                <include>*.exec</include>
                            </includes>
                        </fileSet>
                    </fileSets>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>unit</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.14.1</version>
                        <configuration>
                            <compilerVersion>1.8</compilerVersion>
                            <fork>true</fork>
                            <debug>true</debug>
                            <optimize>true</optimize>
                            <showDeprecation>true</showDeprecation>
                            <showWarnings>true</showWarnings>
                            <source>8</source>
                            <target>8</target>
                            <excludes>
                                <exclude>**/package-info.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.5.2</version>
                        <configuration>
                            <includes>
                                <include>**/*Test.java</include>
                            </includes>
                            <systemPropertyVariables>
                                <logback.configurationFile>${logging.config}</logback.configurationFile>
                                <logLevel>${logging.logLevel}</logLevel>
                            </systemPropertyVariables>
                            <trimStackTrace>false</trimStackTrace>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integration</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <id>process-test-classes</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.5.2</version>
                        <configuration>
                            <includes>
                                <include>**/*IT.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/*TarantoolContainer*IT.java</exclude>
                            </excludes>
                            <systemPropertyVariables>
                                <logback.configurationFile>${logging.config}</logback.configurationFile>
                                <logLevel>${logging.logLevel}</logLevel>
                            </systemPropertyVariables>
                            <trimStackTrace>false</trimStackTrace>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>tarantool-container</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.5.2</version>
                        <configuration>
                            <includes>
                                <include>**/*TarantoolContainer*IT.java</include>
                            </includes>
                            <systemPropertyVariables>
                                <logback.configurationFile>${logging.config}</logback.configurationFile>
                                <logLevel>${logging.logLevel}</logLevel>
                            </systemPropertyVariables>
                            <trimStackTrace>false</trimStackTrace>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sonatypeSnapshot</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central-portal-snapshots</publishingServerId>
                            <deploymentName>io.tarantool.testcontainers-java-tarantool</deploymentName>
                            <waitUntil>uploaded</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sonatypeRelease</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <deploymentName>io.tarantool.testcontainers-java-tarantool</deploymentName>
                            <waitUntil>uploaded</waitUntil>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.1</version>
                        <configuration>
                            <archive>
                                <manifestEntries>
                                    <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
                                    <Bundle-Name>${project.name}</Bundle-Name>
                                    <Bundle-SymbolicName>${project.groupId}.${project.artifactId}.source
                                    </Bundle-SymbolicName>
                                    <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
                                </manifestEntries>
                            </archive>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>attach-test-sources</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>test-jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.12.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <name>Central Portal Snapshots</name>
            <id>central-portal-snapshots</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>
