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

    SPDX-FileCopyrightText: Copyright (c) 2025 CLI Assured contributors as indicated by the @author tags
    SPDX-License-Identifier: Apache-2.0

-->
<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.cli-assured</groupId>
    <artifactId>cli-assured-parent</artifactId>
    <version>0.0.1</version>
    <packaging>pom</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Java DSL for testing command line applications</description>
    <url>https://github.com/cli-assured/cli-assured</url>
    <inceptionYear>2025</inceptionYear>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>ppalaga</id>
            <name>Peter Palaga</name>
            <timezone>Europe/Prague</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:cli-assured/cli-assured.git</connection>
        <developerConnection>scm:git:git@github.com:cli-assured/cli-assured.git</developerConnection>
        <url>https://github.com/cli-assured/cli-assured</url>
        <tag>0.0.1</tag>
    </scm>
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/cli-assured/cli-assured/issues</url>
    </issueManagement>

    <properties>

        <!-- Dependency versions in alphabectic order -->
        <commons-compress.version>1.28.0</commons-compress.version>
        <slf4j.version>2.0.17</slf4j.version>
        <junit.version>5.13.4</junit.version>
        <assertj.version>3.27.7</assertj.version>
        <awaitility.version>4.3.0</awaitility.version>
        <quarkus.version>3.32.2</quarkus.version>
        <rest-assured.version>6.0.0</rest-assured.version>

        <!-- Plugins and their dependencies -->
        <central-publishing-maven-plugin.version>0.10.0</central-publishing-maven-plugin.version>
        <editorconfig-maven-plugin.version>0.2.0</editorconfig-maven-plugin.version>
        <formatter-maven-plugin.version>2.29.0</formatter-maven-plugin.version>
        <impsort-maven-plugin.version>1.13.0</impsort-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
        <license-maven-plugin.version>5.0.0</license-maven-plugin.version>
        <maven-clean-plugin.version>3.5.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
        <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <maven-install-plugin.version>3.1.4</maven-install-plugin.version>
        <maven-jar-pluginversion.version>3.5.0</maven-jar-pluginversion.version>
        <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
        <maven-plugin-plugin.version>3.5.2</maven-plugin-plugin.version>
        <maven-project-info-reports-plugin.version>2.9</maven-project-info-reports-plugin.version>
        <maven-release-plugin.version>3.3.1</maven-release-plugin.version>
        <maven-resources-plugin.version>3.4.0</maven-resources-plugin.version>
        <maven-scm-plugin.version>2.2.1</maven-scm-plugin.version>
        <maven-site-plugin.version>3.6</maven-site-plugin.version>
        <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
        <site-maven-plugin.version>0.12</site-maven-plugin.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- maven-compiler-plugin -->
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.showWarnings>true</maven.compiler.showWarnings>

        <!-- license-maven-plugin -->
        <license.failIfMissing>true</license.failIfMissing>
        <license.failIfUnknown>true</license.failIfUnknown>

        <!-- maven-surefire-plugin -->
        <surefire.useFile>false</surefire.useFile>
        <trimStackTrace>false</trimStackTrace>

        <!-- com.github.github:site-maven-plugin -->
        <github.global.server>github</github.global.server>
    </properties>

    <modules>
        <module>cli-assured</module>
        <module>cli-assured-mvn</module>
        <module>cli-assured-test-app</module>
        <module>cli-assured-tests</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.cli-assured</groupId>
                <artifactId>cli-assured</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.cli-assured</groupId>
                <artifactId>cli-assured-test-app</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.cli-assured</groupId>
                <artifactId>cli-assured-mvn</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-core</artifactId>
                <version>${quarkus.version}</version>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>${rest-assured.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>${commons-compress.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <!-- Ordering: alphabetical by groupId and artifactId -->

                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-pluginversion.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <additionalJOption>-Xdoclint:none</additionalJOption>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                        <preparationGoals>package</preparationGoals>
                        <goals>deploy</goals>
                        <releaseProfiles>release</releaseProfiles>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <!-- Both release:prepare and release:perform config -->
                        <arguments>-DskipTests</arguments>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-plugin</artifactId>
                    <version>${maven-scm-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <systemPropertyVariables>
                            <basedir>${project.build.directory}</basedir>
                            <project.version>${project.version}</project.version>
                            <project.build.sourceEncoding>${project.build.sourceEncoding}</project.build.sourceEncoding>
                            <org.slf4j.simpleLogger.showDateTime>true</org.slf4j.simpleLogger.showDateTime>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.ec4j.maven</groupId>
                    <artifactId>editorconfig-maven-plugin</artifactId>
                    <version>${editorconfig-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>${central-publishing-maven-plugin.version}</version>
                    <configuration>
                        <publishingServerId>central</publishingServerId>
                        <autoPublish>true</autoPublish>
                        <waitUntil>published</waitUntil>
                        <waitMaxTime>7200</waitMaxTime>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${formatter-maven-plugin.version}</version>
                    <configuration>
                        <configFile>${maven.multiModuleProjectDirectory}/build/eclipse-formatter-config.xml</configFile>
                        <skip>${format.skip}</skip>
                        <lineEnding>KEEP</lineEnding>
                        <cachedir>${project.build.directory}/cache</cachedir>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>${impsort-maven-plugin.version}</version>
                    <configuration>
                        <removeUnused>true</removeUnused>
                        <staticAfter>true</staticAfter>
                        <lineEnding>KEEP</lineEnding>
                        <skip>${format.skip}</skip>
                        <cachedir>${project.build.directory}/cache</cachedir>
                    </configuration>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>

            <plugin>
                <groupId>org.ec4j.maven</groupId>
                <artifactId>editorconfig-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>check</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>java21</id>
            <activation>
                <jdk>[21,)</jdk>
            </activation>
            <modules>
                <module>cli-assured-tests-java21</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <configuration>
                            <licenseSets>
                                <licenseSet>
                                    <inlineHeader>SPDX-FileCopyrightText: Copyright (c) ${project.inceptionYear} CLI Assured contributors as indicated by the @author tags
SPDX-License-Identifier: Apache-2.0</inlineHeader>
                                    <excludes>
                                        <exclude>**/*.adoc</exclude>
                                        <exclude>**/*.expected.*</exclude>
                                        <exclude>**/create-extension-templates/*</exclude>
                                        <exclude>**/README.*</exclude>
                                        <exclude>**/.gitkeep</exclude>
                                        <exclude>**/ComparableVersion.java</exclude><!-- Keep the original header -->
                                        <exclude>.gitattributes/</exclude>
                                        <exclude>.mvn/wrapper/</exclude>
                                        <exclude>LICENSE</exclude>
                                        <exclude>mvnw</exclude>
                                        <exclude>mvnw.cmd</exclude>
                                        <exclude>.sdkmanrc</exclude>
                                        <exclude>src/test/resources/*.txt</exclude>
                                    </excludes>
                                </licenseSet>
                            </licenseSets>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>format</id>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                                <phase>process-sources</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                                <phase>process-sources</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalOptions>${javadoc.opts}</additionalOptions>
                            <detectOfflineLinks>false</detectOfflineLinks>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
