<?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>org.tabletest</groupId>
    <artifactId>tabletest-junit</artifactId>
    <version>1.2.1</version>
    <packaging>jar</packaging>

    <inceptionYear>2025</inceptionYear>

    <name>TableTest JUnit</name>
    <description>Extension to JUnit for data-driven testing with the TableTest format</description>
    <url>https://github.com/nchaugen/tabletest</url>

    <properties>
        <copyright.holder>Nils Christian Haugen</copyright.holder>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <repository.url>git@github.com:nchaugen/tabletest.git</repository.url>
        <project.scm.id>github</project.scm.id>
        <version.tabletest-parser>1.2.0</version.tabletest-parser>
        <version.tabletest-reporter>1.0.1</version.tabletest-reporter>
        <version.junit>6.0.3</version.junit>
        <version.kotlin>2.2.0</version.kotlin>
        <version.plugin.license>3.0</version.plugin.license>
        <version.plugin.clean>3.2.0</version.plugin.clean>
        <version.plugin.resources>3.2.0</version.plugin.resources>
        <version.plugin.compiler>3.10.1</version.plugin.compiler>
        <version.plugin.surefire>3.1.2</version.plugin.surefire>
        <version.plugin.jar>3.2.2</version.plugin.jar>
        <version.plugin.install>3.0.1</version.plugin.install>
        <version.plugin.deploy>3.0.0</version.plugin.deploy>
        <version.plugin.javadoc>3.11.2</version.plugin.javadoc>
        <version.plugin.source>3.3.1</version.plugin.source>
        <version.plugin.gpg>3.2.7</version.plugin.gpg>
        <version.plugin.publishing>0.7.0</version.plugin.publishing>
        <version.plugin.release>3.1.1</version.plugin.release>
        <surefire.arguments />
    </properties>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>nchaugen</id>
            <name>Nils Christian Haugen</name>
            <email>nchaugen@gmail.com</email>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <issueManagement>
        <system>github.com</system>
        <url>${project.url}</url>
    </issueManagement>

    <scm>
        <connection>scm:git:${repository.url}</connection>
        <developerConnection>scm:git:${repository.url}</developerConnection>
        <url>${repository.url}</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>org.tabletest</groupId>
            <artifactId>tabletest-parser</artifactId>
            <version>${version.tabletest-parser}</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${version.junit}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-commons</artifactId>
            <version>${version.junit}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.tabletest</groupId>
            <artifactId>tabletest-reporter-junit</artifactId>
            <version>${version.tabletest-reporter}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${version.kotlin}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test</artifactId>
            <version>${version.kotlin}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Add licence headers to all files. -->
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${version.plugin.license}</version>
                <configuration>
                    <header>${project.basedir}/../NOTICE</header>
                    <failIfMissing>true</failIfMissing>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <properties>
                        <copyright.holder>${copyright.holder}</copyright.holder>
                    </properties>
                    <includes>
                        <include>**/main/java/**/*.java</include>
                    </includes>
                    <strictCheck>true</strictCheck>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Kotlin compilation -->
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${version.kotlin}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <source>src/main/java</source>
                                <source>target/generated-sources/annotations</source>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <source>src/test/java</source>
                                <source>target/generated-test-sources/test-annotations</source>
                                <source>src/test/kotlin</source>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <jvmTarget>1.8</jvmTarget>
                </configuration>
            </plugin>

            <!-- Java compilation (after Kotlin) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.plugin.compiler}</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>default-testCompile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <release>8</release>
                        </configuration>
                    </execution>
                    <execution>
                        <id>testCompile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <release>17</release>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Release plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${version.plugin.release}</version>
                <configuration>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>${version.plugin.clean}</version>
            </plugin>

            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${version.plugin.jar}</version>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${version.plugin.resources}</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <propertiesEncoding>${project.build.sourceEncoding}</propertiesEncoding>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-install-plugin</artifactId>
                <version>${version.plugin.install}</version>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.plugin.surefire}</version>
                <configuration>
                    <argLine>${surefire.arguments}</argLine>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${version.plugin.deploy}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${version.plugin.javadoc}</version>
                <configuration>
                    <failOnWarnings>false</failOnWarnings>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Creates additional artefacts that are required for deployment. -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Create source code artefact. -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.plugin.source}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Create javadoc artifact. -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.plugin.javadoc}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Sign artefacts. (Requires configuration of gpg on the executing machine.) -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.plugin.gpg}</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>

                    <!-- Publish to Maven Central -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${version.plugin.publishing}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
