<?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>ru.progrm-jarvis</groupId>
    <artifactId>padla</artifactId>
    <version>1.0.0-rc.3</version>
    <modules>
        <module>java-commons</module>
        <module>reflector</module>
        <module>ultimate-messenger</module>
        <module>tools</module>
    </modules>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <!-- Testing -->
        <version.junit>5.7.2</version.junit>
        <version.junit.platform>1.7.2</version.junit.platform>
        <version.mockito>3.10.0</version.mockito>
    </properties>

    <name>PADLA for Java</name>
    <description>Pack of Java utilities for various needs</description>
    <url>https://padla.progrm-jarvis.ru/</url>

    <inceptionYear>2019</inceptionYear>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/JarvisCraft/padla</url>
        <connection>scm:git:git://github.com:JarvisCraft/padla.git</connection>
        <developerConnection>scm:git:git@github.com:JarvisCraft/padla.git</developerConnection>
    </scm>

    <developers>
        <developer>
            <id>progrm-jarvis</id>
            <name>JARvis PROgrammer (Peter P.)</name>
            <email>mrjarviscraft@gmail.com</email>
            <url>https://github.com/JarvisCraft</url>
            <roles>
                <role>Lead developer</role>
            </roles>
            <timezone>3</timezone>
            <properties>
                <social.vk>PROgrm_JARvis</social.vk>
                <social.twitter>PROgrm_JARvis</social.twitter>
                <social.telegram>PROgrm_JARvis</social.telegram>
            </properties>
        </developer>
    </developers>

    <build>
        <defaultGoal>verify install</defaultGoal>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <!-- Code-generation -->
                <plugin>
                    <groupId>org.apache.drill.tools</groupId>
                    <artifactId>drill-fmpp-maven-plugin</artifactId>
                    <version>1.18.0</version>
                    <executions>
                        <execution>
                            <id>generate-fmpp</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                            <configuration>
                                <config>src/main/freemarker/config.fmpp</config>
                                <templates>src/main/freemarker/templates</templates>
                                <output>${project.build.directory}/generated-sources</output>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Testing -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M5</version>
                </plugin>

                <!-- Maven-central deployment-related plugins -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.3.0</version>
                    <configuration>
                        <tags>
                            <tag>
                                <name>apiNote</name>
                                <placement>a</placement>
                                <head>API note</head>
                            </tag>
                            <tag>
                                <name>implNote</name>
                                <placement>a</placement>
                                <head>Implementation note</head>
                            </tag>
                            <tag>
                                <name>implSpec</name>
                                <placement>a</placement>
                                <head>Implementation specification</head>
                            </tag>
                        </tags>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>java-commons</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>reflector</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Libraries -->
            <dependency>
                <groupId>com.github.ben-manes.caffeine</groupId>
                <artifactId>caffeine</artifactId>
                <version>2.9.1</version>
            </dependency>

            <!-- Bytecode generation -->
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm</artifactId>
                <version>9.1</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>3.28.0-GA</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>

            <!-- Code generation -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.18.20</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>

            <!-- Documenting -->
            <dependency>
                <groupId>org.jetbrains</groupId>
                <artifactId>annotations</artifactId>
                <version>21.0.0</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>

            <!-- Testing -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${version.junit}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${version.junit}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${version.junit}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
                <version>${version.junit.platform}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>1.3</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <!-- Specified in case it is needed (though tests run normally without it) -->
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-runner</artifactId>
                <version>${version.junit.platform}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-surefire-provider</artifactId>
                <version>1.3.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${version.mockito}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${version.mockito}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <!-- Deployment-related profiles -->
        <profile>
            <id>build-extras</id>
            <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>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sign-artifacts</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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Repository profiles -->
        <profile>
            <id>sonatype-ossrh-deployment</id>
            <distributionManagement>
                <repository>
                    <!-- This one is used for automatic sync with Maven Central -->
                    <id>sonatype-ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
                <snapshotRepository>
                    <id>sonatype-ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>github-package-registry-deployment</id>
            <distributionManagement>
                <repository>
                    <id>github-package-registry</id>
                    <url>https://maven.pkg.github.com/JarvisCraft/padla</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>automatic-central-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

