<?xml version="1.0" encoding="UTF-8"?>
<!--

    This file is part of VoltSP.
    Copyright (C) 2024-2026 Volt Active Data Inc. All rights reserved.

-->
<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">
    <parent>
        <artifactId>volt-stream</artifactId>
        <groupId>org.voltdb</groupId>
        <version>1.8.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>volt-stream-testcontainer</artifactId>
    <name>VoltSP TestContainer</name>
    <description>TestContainer implementation for VoltSP integration testing</description>

    <properties>
        <maven.deploy.skip>false</maven.deploy.skip>
        <maven.compiler.release>17</maven.compiler.release>

        <!--suppress UnresolvedMavenProperty -->
        <tag.name.latest>${project.version}--latest</tag.name.latest>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.voltdb</groupId>
            <artifactId>volt-stream-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.voltdb</groupId>
            <artifactId>volt-stream-junit-extension</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.voltdb</groupId>
            <artifactId>volt-stream-docker</artifactId>
            <version>${project.version}</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.voltdb</groupId>
            <artifactId>volt-stream-plugin-http-api</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j2.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j2.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>io.github.git-commit-id</groupId>
                <artifactId>git-commit-id-maven-plugin</artifactId>
                <version>9.0.2</version>
                <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>${project.build.directory}/git.properties
                    </generateGitPropertiesFilename>
                    <includeOnlyProperties>
                        <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
                        <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
                        <includeOnlyProperty>^git.tags$</includeOnlyProperty>
                        <includeOnlyProperty>^git.branch$</includeOnlyProperty>
                    </includeOnlyProperties>
                    <commitIdGenerationMode>full</commitIdGenerationMode>
                    <failOnNoGitDirectory>false</failOnNoGitDirectory>
                    <skipPoms>false</skipPoms>
                    <verbose>true</verbose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <skipSource>false</skipSource>
                    <attach>true</attach>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.5.3</version>
                <configuration>
                    <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                    <systemPropertyVariables>
                        <imageTag>${tag.name.latest}</imageTag>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!--    fallback to master&#45;&#45;latest-->
    <profiles>
        <profile>
            <id>no-docker</id>
            <properties>
                <tag.name.latest>master--latest</tag.name.latest>
            </properties>
        </profile>
    </profiles>
</project>
