<?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>net.rpcnet.securitytoolkit</groupId>
    <artifactId>securitytoolkit-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0.2</version>

    <name>RPCNET Java Security Toolkit</name>

    <description>
        The RPCNET Java Security Toolkit is a java library designed to handle several common
        operations related with security such as expanding a ShortURL and checking if a domain is
        subject to a Zone Transfer DNS query.
    </description>

    <url>https://github.com/rpcaldeira/security-toolkit</url>

    <organization>
        <name>Rui Pedro Caldeira</name>
        <url>https://github.com/rpcaldeira/security-toolkit</url>
    </organization>

    <inceptionYear>2020</inceptionYear>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/rpcaldeira/security-toolkit/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/rpcaldeira/security-toolkit</url>
    </ciManagement>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://opensource.org/licenses/Apache-2.0</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:rpcaldeira/security-toolkit.git</connection>
        <developerConnection>scm:git:git@github.com:rpcaldeira/security-toolkit.git</developerConnection>
        <url>https://github.com/rpcaldeira/security-toolkit</url>
        <tag>securitytoolkit-parent-1.0.2</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <developers>
        <developer>
            <id>rpcaldeira</id>
            <name>Rui Pedro Caldeira</name>
            <email>TheCakeIsALie@rpcnet.net</email>
        </developer>
    </developers>

    <modules>
        <module>web</module>
        <module>mail</module>
        <module>dns</module>
        <module>common</module>
        <module>securitytoolkit</module>
    </modules>

    <properties>
        <!-- Project Properties -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-version>3.6</maven-version>
        <java-version>11</java-version>
        <maven.compiler.source>${java-version}</maven.compiler.source>
        <maven.compiler.target>${java-version}</maven.compiler.target>

        <!-- Dependencies Versions -->
        <junit.version>5.6.2</junit.version>
        <slf4j.version>1.7.30</slf4j.version>
        <dnsjava.version>3.2.2</dnsjava.version>
        <immutables.version>2.8.2</immutables.version>
        <javax-annotation-api.version>1.3.2</javax-annotation-api.version>
        <mockito-core.version>3.6.0</mockito-core.version>

        <!-- Maven Plugins Versions -->
        <maven-shade-plugin.version>2.4.3</maven-shade-plugin.version>
        <maven-source-plugin.version>3.2.0</maven-source-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
        <jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version>
        <license-maven-plugin.version>2.0.0</license-maven-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-scm-provider-gitexe.version>1.9.5</maven-scm-provider-gitexe.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Functional Dependencies -->
            <dependency>
                <groupId>dnsjava</groupId>
                <artifactId>dnsjava</artifactId>
                <version>${dnsjava.version}</version>
            </dependency>

            <!-- Clean Code Dependencies -->
            <dependency>
                <groupId>org.immutables</groupId>
                <artifactId>value</artifactId>
                <version>${immutables.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- Logging Dependencies -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- Test Dependencies -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito-core.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Internal Dependencies -->
            <dependency>
                <groupId>net.rpcnet.securitytoolkit</groupId>
                <artifactId>web</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.rpcnet.securitytoolkit</groupId>
                <artifactId>mail</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.rpcnet.securitytoolkit</groupId>
                <artifactId>dns</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.rpcnet.securitytoolkit</groupId>
                <artifactId>common</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-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-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-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.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-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-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>${maven-scm-provider-gitexe.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <sourcepath>${project.build.sourceDirectory}:${project.build.directory}/generated-sources/annotations</sourcepath>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                    <additionalDependencies>
                        <additionalDependency>
                            <groupId>javax.annotation</groupId>
                            <artifactId>javax.annotation-api</artifactId>
                            <version>${javax-annotation-api.version}</version>
                        </additionalDependency>
                    </additionalDependencies>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>${maven-version}</version>
                                    <message>Invalid Maven version. It should, at least, be ${maven-version}</message>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${java-version}</version>
                                    <message>Invalid Java version. It should, at least, be ${java-version}</message>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- GPG Signature on release -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <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>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>third-party-licenses</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>third.party.licenses</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>aggregate-add-third-party</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.basedir}</outputDirectory>
                                    <thirdPartyFilename>THIRD_PARTY_LICENSES</thirdPartyFilename>
                                    <excludedGroups>net\.rpcnet</excludedGroups>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>