<?xml version="1.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>tv.hd3g.commons</groupId>
    <artifactId>starter</artifactId>
    <packaging>pom</packaging>
    <version>21.2.0</version>

    <name>Commons Maven starter project</name>
    <url>https://github.com/hdsdi3g/prodlib</url>
    <description>Maven starter project for all hdsdi3g' java projects</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.3.1</version>
        <relativePath />
    </parent>

    <modules>
        <module>parent</module>
        <module>parent-web</module>
        <module>testtools</module>
        <module>interfaces</module>
        <module>env-version</module>
        <module>jsconfig</module>
        <module>app</module>
        <module>app-web</module>
        <module>mailkit</module>
        <module>jobkit</module>
        <module>transfertfiles</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>21</maven.compiler.release>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <java.version>21</java.version>
        <aspectj-java.version>21</aspectj-java.version>

        <mockito.version>5.12.0</mockito.version>
        <datafaker.version>1.6.0</datafaker.version>
        <owasp.encoder.version>1.2.3</owasp.encoder.version>
        <ognl.version>3.3.4</ognl.version>
        <commons.text.version>1.11.0</commons.text.version>
        <commons.net.version>3.10.0</commons.net.version>
        <commons.io.version>2.16.1</commons.io.version>
        <commons.compress.version>1.26.1</commons.compress.version>
        <commons.collections4.version>4.4</commons.collections4.version>
        <httpclient.version>4.5.14</httpclient.version>
        <sshj.version>0.38.0</sshj.version>
        <bouncycastle.version>1.78</bouncycastle.version>
        <xz.version>1.9</xz.version>
        <ftpserver.version>1.2.0</ftpserver.version>
        <sshd.version>2.12.1</sshd.version>
        <jsch.version>0.2.17</jsch.version>
        <j2html.version>1.6.0</j2html.version>
        <graalvm.version>22.3.1</graalvm.version>
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>3.3.0</maven-surefire-plugin.version>
        <maven.gpg.version>3.2.4</maven.gpg.version>
        <gpg.skip>true</gpg.skip>
        <native.skip>true</native.skip>
        <license-maven-plugin.version>2.0.0</license-maven-plugin.version>
        <nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
        <aspectj-maven-plugin.version>1.14.0</aspectj-maven-plugin.version>
        <maven.jacoco.version>0.8.12</maven.jacoco.version>
        <sonar.version>3.11.0.3922</sonar.version>

        <codepolicyvalidation.version>3.1.1</codepolicyvalidation.version>
        <processlauncher.version>6.0.5</processlauncher.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>tv.hd3g.commons</groupId>
            <artifactId>codepolicyvalidation</artifactId>
            <version>${codepolicyvalidation.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.datafaker</groupId>
            <artifactId>datafaker</artifactId>
            <version>${datafaker.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>ognl</groupId>
                <artifactId>ognl</artifactId>
                <version>${ognl.version}</version>
            </dependency>
            <dependency>
                <groupId>org.owasp.encoder</groupId>
                <artifactId>encoder</artifactId>
                <version>${owasp.encoder.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-collections4</artifactId>
                <version>${commons.collections4.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>${commons.compress.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpclient.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.j2html</groupId>
                <artifactId>j2html</artifactId>
                <version>${j2html.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <organization>
        <name>hd3g.tv</name>
        <url>https://hd3g.tv</url>
    </organization>
    <developers>
        <developer>
            <name>hdsdi3g</name>
            <email>admin@hd3g.tv</email>
            <organization>hd3g.tv</organization>
            <organizationUrl>https://hd3g.tv</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/hdsdi3g/prodlib.git</connection>
        <developerConnection>scm:git:ssh://github.com/hdsdi3g/prodlib.git</developerConnection>
        <url>https://github.com/hdsdi3g/prodlib</url>
        <tag>HEAD</tag>
    </scm>
    <issueManagement>
        <url>https://github.com/hdsdi3g/prodlib/issues</url>
        <system>GitHub</system>
    </issueManagement>
    <licenses>
        <license>
            <name>GNU Lesser General Public License, Version 3</name>
            <url>https://www.gnu.org/licenses/lgpl.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <profiles>
        <profile>
            <id>coverage</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${maven.jacoco.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report-aggregate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sonar</id>
            <properties>
                <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
            </properties>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <version>${sonar.version}</version>
                        <executions>
                            <execution>
                                <id>sonar</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sonar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <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>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version> <!--$NO-MVN-MAN-VER$-->
                <configuration>
                    <release>${maven.compiler.release}</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version> <!--$NO-MVN-MAN-VER$-->
                <!-- https://github.com/raphw/byte-buddy/discussions/1535#top -->
                <configuration>
                    <argLine>-javaagent:"${project.build.directory}/test-agent/byte-buddy-agent-${byte-buddy.version}.jar"</argLine>
                </configuration>
            </plugin>
            <plugin>
                <!-- https://github.com/raphw/byte-buddy/discussions/1535#top -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifact>net.bytebuddy:byte-buddy-agent:${byte-buddy.version}</artifact>
                            <outputDirectory>${project.build.directory}/test-agent</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven.gpg.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                            <passphraseServerId>${gpg.keyname}</passphraseServerId>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>add-third-party</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.basedir}</outputDirectory>
                            <useMissingFile>true</useMissingFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
