<?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>
    <parent>
        <groupId>org.tabletest</groupId>
        <artifactId>tabletest-reporter</artifactId>
        <version>1.5.0</version>
    </parent>

    <artifactId>tabletest-reporter-junit</artifactId>
    <packaging>jar</packaging>

    <name>TableTest Reporter JUnit Extension</name>

    <properties>
        <!-- This module loads into the user's test JVM, so it targets the oldest LTS
             TableTest itself supports; the rest of the build stays on 21. Use `release`,
             not source/target, so a Java 21 API cannot be referenced by accident. -->
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <version.tabletest-junit>1.2.2</version.tabletest-junit>
        <version.tabletest-parser>1.2.1</version.tabletest-parser>
        <version.snakeyaml>3.1.1</version.snakeyaml>
        <version.junit>6.1.3</version.junit>
        <version.assertj>3.27.7</version.assertj>
    </properties>

    <dependencies>
        <!-- JUnit Jupiter API for extension -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${version.junit}</version>
            <scope>provided</scope>
        </dependency>

        <!-- TableTest library for parser and JUnit integration -->
        <dependency>
            <groupId>org.tabletest</groupId>
            <artifactId>tabletest-parser</artifactId>
            <version>${version.tabletest-parser}</version>
        </dependency>
        <dependency>
            <groupId>org.tabletest</groupId>
            <artifactId>tabletest-junit</artifactId>
            <version>${version.tabletest-junit}</version>
        </dependency>
        <!-- @ConvertWith, behind the @Lines column-role annotation; always present with @TableTest -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${version.junit}</version>
            <scope>provided</scope>
        </dependency>

        <!-- YAML writing -->
        <dependency>
            <groupId>org.snakeyaml</groupId>
            <artifactId>snakeyaml-engine</artifactId>
            <version>${version.snakeyaml}</version>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-testkit</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${version.assertj}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <!-- Living documentation: this module's own naming rules belong in the reporter's spec,
             so under -Preport its tests run with the extension and leave their YAML in
             target/junit-jupiter. The report itself is generated by tabletest-reporter-core,
             which lists this directory in <inputDirectories> — the plugin is deliberately not
             declared here, since a reporter module declaring it closes a reactor cycle
             (products/reporter/gotchas/self-hosting-reactor-cycle.md). -->
        <profile>
            <id>report</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <properties>
                                <configurationParameters>
                                    junit.jupiter.extensions.autodetection.enabled=true
                                </configurationParameters>
                            </properties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
