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

        This file is part of the 'SquashAutomation Tm Libraries' project.
        Copyright (C) 2023 - 2026 Henix, https://www.henix.fr - All Rights Reserved

        Unauthorized copying of this file, via any medium is strictly prohibited
        Proprietary and confidential

-->
<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>io.micronaut.platform</groupId>
        <artifactId>micronaut-parent</artifactId>
        <version>4.1.4</version>
    </parent>

    <groupId>org.squashtest.squash.automation</groupId>
    <artifactId>tm-libraries</artifactId>
    <version>1.15.0.RC1</version>
    <packaging>pom</packaging>

    <name>SquashAutomation Tm Libraries</name>
    <inceptionYear>2023</inceptionYear>

    <licenses>
        <license>
            <name>Henix</name>
        </license>
    </licenses>

    <organization>
        <name>Henix</name>
        <url>https://www.henix.fr</url>
    </organization>

    <modules>
        <module>tm-commons</module>
        <module>tm-testplan-library</module>
    </modules>


    <repositories>
        <repository>
            <id>henix-nexus-acceptance</id>
            <url>https://nexus.squashtest.org/nexus/repository/maven-acceptance/</url>
        </repository>
    </repositories>

    <properties>
        <revision>1.15.0</revision>
        <changelist>-SNAPSHOT</changelist>
        <sha1></sha1>

        <sonar.organization>henixdevelopment</sonar.organization>
        <sonar.projectKey>${project.groupId}:${project.artifactId}${env.APPEND_SONAR_PROJECT_KEY}</sonar.projectKey>
        <sonar.projectName>${project.name}${env.APPEND_SONAR_PROJECT_NAME}</sonar.projectName>

        <license.name>Henix</license.name>
        <project.label>SquashAutomation Tm Libraries</project.label>
        <license.current.year>2026</license.current.year>
        <jdk.version>25</jdk.version>
        <release.version>25</release.version>
        <root.module.baseDir>${project.basedir}</root.module.baseDir>

        <junit.jupiter.version>5.10.2</junit.jupiter.version>
        <java.toolkit.version>1.16.0.RC1</java.toolkit.version>
        <commons.io.version>2.16.1</commons.io.version>

        <maven.surefire.plugin.version>3.2.5</maven.surefire.plugin.version>
        <jakarta.activation.api.version>2.1.3</jakarta.activation.api.version>

        <maven.license.version>4.3</maven.license.version>
        <spotless-maven-plugin.version>3.1.0</spotless-maven-plugin.version>
        <google-java-format.version>1.33.0</google-java-format.version>
        <ci.friendly.flatten.maven.plugin.version>1.0.19</ci.friendly.flatten.maven.plugin.version>
        <native.maven.plugin.version>0.9.21</native.maven.plugin.version>
        <maven.assembly.plugin.version>3.7.1</maven.assembly.plugin.version>

        <gmavenplus.plugin.version>4.0.1</gmavenplus.plugin.version>
        <groovy.version>5.0.0-alpha-11</groovy.version>
    </properties>

    <distributionManagement>
        <repository>
            <id>squash-release-deploy-repo</id>
            <name>Squash releases deployment repo</name>
            <url>${deploy-repo.release.url}</url>
        </repository>
        <snapshotRepository>
            <id>squash-snapshot-deploy-repo</id>
            <name>Squash snapshots deployment repo</name>
            <url>${deploy-repo.snapshot.url}</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>jakarta.activation</groupId>
                <artifactId>jakarta.activation-api</artifactId>
                <version>${jakarta.activation.api.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.opentestfactory</groupId>
            <artifactId>otf-test-utils</artifactId>
            <version>${java.toolkit.version}</version>
        </dependency>

        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>${groovy.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>25</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${maven.license.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>initialize</phase>
                    </execution>
                </executions>
                <configuration>
                    <properties>
                        <project.label>${project.label}</project.label>
                        <license.copyrightOwner>${project.organization.name}, ${project.organization.url}</license.copyrightOwner>
                        <license.yearSpan>${project.inceptionYear} - ${license.current.year}</license.yearSpan>
                    </properties>
                    <aggregate>true</aggregate>
                    <strictCheck>true</strictCheck>
                    <useDefaultExcludes>true</useDefaultExcludes>
                    <mapping>
                        <md>XML_STYLE</md>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                    <licenseSets>
                        <licenseSet>
                            <header>${root.module.baseDir}/src/main/license/${license.name}-license-header.txt</header>
                            <excludes>
                                <exclude>**/*.pub</exclude>
                                <exclude>**/*.in</exclude>
                                <exclude>**/*.jwt</exclude>
                                <exclude>**/*.bintxt</exclude>
                                <exclude>**/.m2/**</exclude>
                            </excludes>
                        </licenseSet>
                    </licenseSets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless-maven-plugin.version}</version>
                <configuration>
                    <java>
                        <googleJavaFormat>
                            <version>${google-java-format.version}</version>
                        </googleJavaFormat>
                        <!--
                        Indentation works as follows:
                        - Google Format indents with 2 spaces
                        - We force each 2 spaces to become a tabulation
                        - We force each tabulation to become 4 spaces
                        -->
                        <indent>
                            <tabs>true</tabs>
                            <spacesPerTab>2</spacesPerTab>
                        </indent>
                        <indent>
                            <spaces>true</spaces>
                            <spacesPerTab>4</spacesPerTab>
                        </indent>
                        <removeUnusedImports />
                    </java>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.outbrain.swinfra</groupId>
                <artifactId>ci-friendly-flatten-maven-plugin</artifactId>
                <version>${ci.friendly.flatten.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <!-- Ensure proper cleanup. Will run on clean phase-->
                            <goal>clean</goal>
                            <!-- Enable ci-friendly version resolution. Will run on process-resources phase-->
                            <goal>flatten</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>add-windows-hg-hooks</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.gmavenplus</groupId>
                        <artifactId>gmavenplus-plugin</artifactId>
                        <version>${gmavenplus.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>add-windows-hg-hooks</id>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <phase>process-resources</phase>
                                <inherited>false</inherited>
                                <configuration>
                                    <scripts>
                                        <script>${project.basedir}/src/main/scripts/AppendGitPreCommitHookForWindows.groovy</script>
                                    </scripts>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.groovy</groupId>
                                <artifactId>groovy</artifactId>
                                <version>${groovy.version}</version>
                                <scope>runtime</scope>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>add-unix-like-hg-hooks</id>
            <activation>
                <os>
                    <family>unix</family>
                </os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.gmavenplus</groupId>
                        <artifactId>gmavenplus-plugin</artifactId>
                        <version>${gmavenplus.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>add-unix-like-hg-hooks</id>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <phase>process-resources</phase>
                                <inherited>false</inherited>
                                <configuration>
                                    <scripts>
                                        <script>${project.basedir}/src/main/scripts/AppendGitPreCommitHookForUnix.groovy</script>
                                    </scripts>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.groovy</groupId>
                                <artifactId>groovy</artifactId>
                                <version>${groovy.version}</version>
                                <scope>runtime</scope>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
