<?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
                             https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.github.danielgp-eu</groupId>
    <artifactId>tools</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>

    <name>tools</name>
    <description>Various Java classes to be re-used</description>
    <url>https://github.com/danielgp-eu/tools</url>

    <licenses>
        <license>
            <name>Mozilla Public License Version 2.0</name>
            <url>https://opensource.org/license/mpl-2-0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>danielgp.eu</id>
            <name>Daniel-Gheorghe Popiniuc</name>
            <email>danielpopiniuc@gmail.com</email>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+2</timezone>
            <organization>danielgp-eu</organization>
            <organizationUrl>https://github.com/danielgp-eu</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/danielgp-eu/tools.git</connection>
        <developerConnection>scm:git:ssh://github.com/danielgp-eu/tools.git</developerConnection>
        <url>https://github.com/danielgp-eu/tools</url>
    </scm>

    <modules>
        <module>tools-core</module>
        <module>tools-archiving</module>
        <module>tools-databases</module>
        <module>tools-environment</module>
        <module>tools-incubator</module>
        <module>tools-json_split</module>
        <module>tools-utils</module>
        <module>tools-web</module>
    </modules>

    <properties>
        <revision>1.0.6</revision>
        <!-- File encoding properties -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <!-- Build properties -->
        <java.version>26</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.compiler.release>${java.version}</maven.compiler.release>
        <sonar.organization>danielgp-eu</sonar.organization>
        <!-- Dependency versions -->
        <jackson.version>3.2.0</jackson.version>
        <jspecify.version>1.0.0</jspecify.version>
        <junit-jupiter.version>6.1.0</junit-jupiter.version>
        <jte.version>3.2.4</jte.version>
        <log4j-core.version>2.26.0</log4j-core.version>
        <log4j-slf4j2-impl.version>2.26.0</log4j-slf4j2-impl.version>
        <maven-model.version>3.9.16</maven-model.version>
        <oshi-core-ffm.version>7.3.1</oshi-core-ffm.version>
        <picocli.version>4.7.7</picocli.version>
        <plexus-interpolation.version>1.29</plexus-interpolation.version>
        <sqlite-jdbc.version>3.53.2.0</sqlite-jdbc.version>
        <undertow-core.version>2.4.1.Final</undertow-core.version>
        <!-- Build Plugin versions -->
        <central-publishing-maven-plugin.version>0.10.0</central-publishing-maven-plugin.version>
        <dependency-check-maven.version>12.2.2</dependency-check-maven.version>
        <flatten-maven-plugin.version>1.7.3</flatten-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.15</jacoco-maven-plugin.version>
        <maven-antrun-plugin.version>3.2.0</maven-antrun-plugin.version>
        <maven-assembly-plugin.version>3.8.0</maven-assembly-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
        <takari-lifecycle-plugin.version>2.3.4</takari-lifecycle-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Source: https://github.com/oshi/oshi -->
            <!-- Binaries: https://repo1.maven.org/maven2/com/github/oshi/oshi-core-ffm -->
            <!-- Description: A JNA-based (native) operating system information library for Java that aims to provide a cross-platform implementation to retrieve system information, such as version, memory, CPU, disk, battery, etc. -->
            <!-- oshi-core implementation using FFM -->
            <dependency>
                <groupId>com.github.oshi</groupId>
                <artifactId>oshi-core-ffm</artifactId>
                <version>${oshi-core-ffm.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://jte.gg/ -->
            <!-- Binaries: https://repo1.maven.org/maven2/gg/jte/jte -->
            <!-- Description: Java Template Engine -->
            <dependency>
                <groupId>gg.jte</groupId>
                <artifactId>jte</artifactId>
                <version>${jte.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://picocli.info/ -->
            <!-- Binaries: https://repo1.maven.org/maven2/info/picocli/picocli -->
            <!-- Description: Java command line parser with both an annotations API and a programmatic API. Usage help with ANSI styles and colors. Autocomplete. Nested subcommands. Easily included as source to avoid adding a dependency. -->
            <dependency>
                <groupId>info.picocli</groupId>
                <artifactId>picocli</artifactId>
                <version>${picocli.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://github.com/undertow-io/undertow/tags -->
            <!-- Binaries: https://repo1.maven.org/maven2/io/undertow/undertow-core -->
            <!-- Description: The core module of Undertow, a lightweight and high-performance web server for Java. -->
            <dependency>
                <groupId>io.undertow</groupId>
                <artifactId>undertow-core</artifactId>
                <version>${undertow-core.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://logging.apache.org/log4j/2.x/ -->
            <!-- Binaries: https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core -->
            <!-- Description: Implementation for Apache Log4J, a highly configurable logging tool that focuses on performance and low garbage generation. It has a plugin architecture that makes it extensible and supports asynchronous logging based on LMAX Disruptor. -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j-core.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://logging.apache.org/log4j/2.x/ -->
            <!-- Binaries: https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-slf4j2-impl -->
            <!-- Description: The Apache Log4j SLF4J 2.0 API binding to Log4j 2 Core -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j2-impl</artifactId>
                <version>${log4j-slf4j2-impl.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://maven.apache.org/download.cgi -->
            <!-- Binaries: https://repo1.maven.org/maven2/org/apache/maven/maven-core -->
            <!-- Description: Core classes of Apache Maven to manage the building process. -->
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-model</artifactId>
                <version>${maven-model.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-interpolation -->
            <!-- Binaries: https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-interpolation -->
            <!-- Description: A collection of various utility classes to ease working with strings, files, command lines and more. -->
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-interpolation</artifactId>
                <version>${plexus-interpolation.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://jspecify.dev/ -->
            <!-- Binaries: https://repo1.maven.org/maven2/org/jspecify/jspecify -->
            <!-- JSpecify for null safety -->
            <dependency>
                <groupId>org.jspecify</groupId>
                <artifactId>jspecify</artifactId>
                <version>${jspecify.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Test dependencies -->
            <!-- Source: https://junit.org/ -->
            <!-- Binaries: https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter -->
            <!-- Description: Module "junit-jupiter" of JUnit -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- Source: https://github.com/xerial/sqlite-jdbc/releases -->
            <!-- Binaries: https://repo1.maven.org/maven2/org/xerial/sqlite-jdbc -->
            <!-- Description: SQLite JDBC is a library for accessing and creating SQLite database files in Java (it includes native libraries) -->
            <dependency>
                <groupId>org.xerial</groupId>
                <artifactId>sqlite-jdbc</artifactId>
                <version>${sqlite-jdbc.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://github.com/FasterXML/jackson -->
            <!-- Binaries: https://repo1.maven.org/maven2/tools/jackson/core/jackson-databind -->
            <!-- Description: General data-binding functionality for Jackson: works on core streaming API -->
            <dependency>
                <groupId>tools.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
                <scope>compile</scope>
            </dependency>
            <!-- Source: https://github.com/FasterXML/jackson-dataformat-xml -->
            <!-- Binaries: https://repo1.maven.org/maven2/tools/jackson/dataformat/jackson-dataformat-xml -->
            <!-- Description: Data format extension for Jackson to offer alternative support for serializing POJOs as XML and deserializing XML as POJOs. -->
            <dependency>
                <groupId>tools.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${jackson.version}</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <!-- Source: https://github.com/takari/takari-lifecycle/releases -->
                <!-- Binaries: https://repo1.maven.org/maven2/io/takari/maven/plugins/takari-lifecycle-plugin -->
                <!-- Description: Takari Lifecycle Plugin -->
                <plugin>
                    <groupId>io.takari.maven.plugins</groupId>
                    <artifactId>takari-lifecycle-plugin</artifactId>
                    <version>${takari-lifecycle-plugin.version}</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <sourceJar>true</sourceJar>
                        <testJar>false</testJar>
                        <verbose>true</verbose>
                    </configuration>
                </plugin>
                <!-- Source: https://maven.apache.org/plugins/maven-antrun-plugin/ -->
                <!-- Binaries: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-antrun-plugin -->
                <!-- Description: Runs Ant scripts embedded in the POM -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven-antrun-plugin.version}</version>
                </plugin>
                <!-- Source: https://maven.apache.org/plugins/maven-assembly-plugin/download.cgi -->
                <!-- Binaries: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-plugin -->
                <!-- Description: A Maven plugin to create archives of your project's sources, classes, dependencies etc. from flexible assembly descriptors. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                    <configuration>
                        <descriptorRefs>
                            <descriptorRef>jar-with-dependencies</descriptorRef>
                        </descriptorRefs>
                    </configuration>
                    <executions>
                        <execution>
                            <id>make-assembly</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Source: https://maven.apache.org/plugins/maven-gpg-plugin/ -->
                <!-- Binaries: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-gpg-plugin -->
                <!-- Description: Signs the project artifacts with GnuPG. -->
                <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>
                            <configuration>
                                <passphraseEnvName>MAVEN_GPG_PASSPHRASE</passphraseEnvName>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Source: https://maven.apache.org/plugins/maven-javadoc-plugin/download.cgi -->
                <!-- Binaries: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin -->
                <!-- Description: The Apache Maven Javadoc Plugin is a plugin that uses the javadoc tool for generating javadocs for the specified project. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <doclint>none</doclint>
                    </configuration>
                </plugin>
                <!-- Source: https://maven.apache.org/surefire/maven-surefire-plugin/ -->
                <!-- Binaries: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin -->
                <!-- Description: Maven Surefire MOJO in maven-surefire-plugin. -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                    <version>${flatten-maven-plugin.version}</version>
                    <configuration>
                        <updatePomFile>true</updatePomFile>
                        <flattenMode>resolveCiFriendliesOnly</flattenMode>
                        <pomElements>
                            <parent>expand</parent>
                            <repositories>remove</repositories>
                            <pluginRepositories>remove</pluginRepositories>
                        </pomElements>
                    </configuration>
                    <executions>
                        <execution>
                            <id>flatten</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>flatten</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>flatten-clean</id>
                            <phase>clean</phase>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Source: https://maven.apache.org/surefire/maven-surefire-plugin/ -->
                <!-- Binaries: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin -->
                <!-- Description: Maven Surefire MOJO in maven-surefire-plugin. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <systemPropertyVariables>
                            <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
                        </systemPropertyVariables>
                        <argLine>@{argLine} --enable-native-access=ALL-UNNAMED</argLine>
                    </configuration>
                </plugin>
                <!-- Source: https://www.jacoco.org/jacoco/trunk/doc/maven.html -->
                <!-- Binaries: https://repo1.maven.org/maven2/org/jacoco/jacoco-maven-plugin -->
                <!-- Description: he JaCoCo Maven Plugin provides the JaCoCo runtime agent to your tests and allows basic report creation. -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>default-prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>default-report</id>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>default-check</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <rule>
                                        <element>BUNDLE</element>
                                    </rule>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Source: https://maven.apache.org/surefire/maven-surefire-plugin/ -->
                <!-- Binaries: https://repo1.maven.org/maven2/org/sonatype/central/central-publishing-maven-plugin -->
                <!-- Description: This project is a maven plugin for publishing components in Maven Central, for more details on its usage see https://central.sonatype.org/publish/publish-portal-maven. -->
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>${central-publishing-maven-plugin.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>central</publishingServerId>
                        <autoPublish>true</autoPublish>
                        <waitUntil>published</waitUntil>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>central</id>
            <url>https://central.sonatype.com/api/v1/publisher</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>local</id>
            <activation>
                <property>
                    <name>!release</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-assembly-plugin</artifactId>
                            <version>${maven-antrun-plugin.version}</version>
                            <executions>
                                <execution>
                                    <id>make-fat-jar</id>
                                    <phase>package</phase>
                                    <goals>
                                        <goal>single</goal>
                                    </goals>
                                    <configuration>
                                        <descriptorRefs>
                                            <descriptorRef>jar-with-dependencies</descriptorRef>
                                        </descriptorRefs>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>

</project>
