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

     Copyright (c) 2020 - 2026 Henix, https://www.henix.fr

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.

-->
<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.8.3</version>
    </parent>

    <groupId>org.opentestfactory</groupId>
    <artifactId>micronaut-java-toolkit</artifactId>
    <version>1.16.0.RC1</version>
    <packaging>pom</packaging>

    <name>OpenTestFactory Java-Toolkit</name>
    <inceptionYear>2020</inceptionYear>

    <licenses>
        <license>
            <name>Apache License V2</name>
        </license>
    </licenses>

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

    <modules>
        <module>otf-messages</module>
        <module>otf-dto</module>
        <module>otf-utils</module>
        <module>otf-microservice-components</module>
        <module>otf-report-interpreter-base</module>
        <module>otf-test-harness-tools</module>
        <module>otf-test-utils</module>
    </modules>

    <properties>
        <revision>1.16.0</revision>
        <sha1></sha1>
        <changelist>-SNAPSHOT</changelist>
        <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>Apache-V2</license.name>
        <license.current.year>2026</license.current.year>
        <root.module.baseDir>${project.basedir}</root.module.baseDir>

        <jdk.version>25</jdk.version>
        <release.version>25</release.version>

        <jackson.databind.version>4.8.19</jackson.databind.version>
        <slf4j.api.version>2.0.17</slf4j.api.version>
        <commons.lang3.version>3.17.0</commons.lang3.version>
        <commons.text.version>1.12.0</commons.text.version>
        <commons.io.version>2.17.0</commons.io.version>
        <junit.jupiter.version>5.11.4</junit.jupiter.version>

        <logback.version>1.5.32</logback.version>
        <mockito.core.version>5.14.2</mockito.core.version>

        <license.maven.plugin.version>4.6</license.maven.plugin.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.28</ci.friendly.flatten.maven.plugin.version>

        <groovy.maven.plugin.version>2.1.1</groovy.maven.plugin.version>
        <gmavenplus.plugin.version>4.0.1</gmavenplus.plugin.version>
        <groovy.version>5.0.5</groovy.version>

        <maven.surefire.plugin.version>3.5.5</maven.surefire.plugin.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>
            <!-- Force Groovy 5 for Java 25 compatibility, override Micronaut's version -->
            <dependency>
                <groupId>org.apache.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>${groovy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.jupiter.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.micronaut</groupId>
                <artifactId>micronaut-jackson-databind</artifactId>
                <version>${jackson.databind.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>${commons.text.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons.lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.core.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>initialize</phase>
                    </execution>
                </executions>
                <configuration>
                    <properties>
                        <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>
                        <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>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>append-git-hooks-for-windows</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>append-pre-commit-hook-for-windows</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>append-pre-commit-hook-for-unix</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>
