<?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>app.doqa</groupId>
    <artifactId>doqa-java</artifactId>
    <version>0.1.4</version>
    <packaging>pom</packaging>

    <name>DoQA Java</name>
    <description>
        DoQA reporting for JVM test frameworks: the Autotest API client core, the shared
        framework-agnostic adapter core and the framework adapters (JUnit 5, JUnit 4, TestNG).
        All modules release together under one version.
    </description>

    <url>https://github.com/doqa-app/doqa-java</url>
    <organization>
        <name>DoQA</name>
        <url>https://doqa.app</url>
    </organization>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>doqa</id>
            <name>DoQA team</name>
            <organization>DoQA</organization>
            <organizationUrl>https://doqa.app</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:https://github.com/doqa-app/doqa-java.git</connection>
        <developerConnection>scm:git:git@github.com:doqa-app/doqa-java.git</developerConnection>
        <url>https://github.com/doqa-app/doqa-java</url>
        <tag>HEAD</tag>
    </scm>
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/doqa-app/doqa-java/issues</url>
    </issueManagement>

    <modules>
        <module>doqa-client</module>
        <module>doqa-java-commons</module>
        <module>doqa-junit5</module>
        <module>doqa-junit4</module>
        <module>doqa-testng</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- java.net.http.HttpClient + var require Java 11. -->
        <maven.compiler.release>11</maven.compiler.release>
        <junit.platform.version>1.11.4</junit.platform.version>
        <junit.jupiter.version>5.11.4</junit.jupiter.version>
        <junit4.version>4.13.2</junit4.version>
        <testng.version>7.12.0</testng.version>
        <aspectj.version>1.9.24</aspectj.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.5.0</version>
                    <executions>
                        <execution>
                            <id>enforce-environment</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireJavaVersion>
                                        <version>[11,)</version>
                                    </requireJavaVersion>
                                    <requireMavenVersion>
                                        <version>[3.8,)</version>
                                    </requireMavenVersion>
                                    <dependencyConvergence/>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.6.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <!-- Central requires sources + javadoc for every published artifact. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <configuration>
                    <doclint>none</doclint>
                    <quiet>true</quiet>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Release to Maven Central (Sonatype Central Portal): GPG-signed, published via the
             central-publishing plugin. Used by the release workflow on a version tag; needs the
             `central` server credentials (portal token) and a GPG key in the environment. -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- non-interactive signing on CI -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
