<?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>io.github.wand555</groupId>
    <artifactId>richerconversation-parent</artifactId>
    <version>1.0.3</version>
    <packaging>pom</packaging>
    <modules>
        <module>api</module>
        <module>example</module>
    </modules>

    <name>RicherConversation</name>
    <description>
        A concise library to improve the (old) Conversation API in Spigot.
        This library is designed to bring the useful, underused, but also old Conversation API up to date.
    </description>

    <inceptionYear>2022</inceptionYear>
    <url>https://github.com/wand555/RicherConversation</url>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <scm>
        <connection>scm:https://github.com/wand555/RicherConversation.git</connection>
        <developerConnection>scm:git:git@github.com:wand555/RicherConversation.git</developerConnection>
        <url>https://github.com/wand555/RicherConversation</url>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>


    <pluginRepositories>
        <pluginRepository>
            <id>maven-snapshots</id>
            <url>https://repository.apache.org/content/repositories/snapshots/</url>
        </pluginRepository>
    </pluginRepositories>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://www.opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>wand555</name>
            <email>wand516@gmail.com</email>
            <url>https://github.com/wand555</url>
        </developer>
    </developers>

    <build>
        <defaultGoal>clean package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <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>
                <version>3.2.0</version>
                <configuration>
                    <source>17</source>
                    <additionalOptions>-Xdoclint:none</additionalOptions>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</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-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit tests of an application. It generates XML reports in target/surefire-reports -->
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <classpathDependencyExcludes>
                        <classpathDependencyExclude>org.spigotmc:spigot</classpathDependencyExclude>
                    </classpathDependencyExcludes>
                </configuration>
            </plugin>
            <plugin>
                <!-- The Failsafe plugin is designed to run integration tests while the Surefire Plugin is designed to run unit tests -->
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <classpathDependencyExcludes>
                        <classpathDependencyExclude>org.spigotmc:spigot</classpathDependencyExclude>
                    </classpathDependencyExcludes>
                </configuration>
            </plugin>
            <plugin>
                <!-- The Site plugin generates a site for the project which includes the project's reports configured below -->
                <artifactId>maven-site-plugin</artifactId>
                <version>3.9.1</version>
            </plugin>
            <plugin>
                <!-- The Maven Project Info Reports plugin reports information about the project for the site -->
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.1.1</version>
            </plugin>
            <plugin>
                <!-- The JaCoCo plugin runs JaCoCo to compute coverage of the test cases -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.7</version>
                <executions>
                    <execution>
                        <goals>
                            <!-- Prepares a property pointing to the JaCoCo runtime agent that can be passed as a VM argument to the application under test -->
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <!-- The JXR Plugin produces a cross-reference of the project's sources, which is handy when used with the PMD Plugin for referencing errors found in the code. -->
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
            <plugin>
                <!-- The Surefire Report Plugin parses the generated XML files under target/surefire-reports and renders them using DOXIA, which creates the web interface version of the test results. -->
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.22.2</version>
            </plugin>
            <plugin>
                <!-- The PMD plugin runs the PMD code analysis tool on your project's source code and generate a site report with its results. It also supports the separate Copy/Paste Detector tool (or CPD) distributed with PMD. -->
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.15.0</version>
                <configuration>
                    <!-- Run PMD and CPD on the tests, too -->
                    <includeTests>true</includeTests>
                    <rulesets>
                        <!-- We are using a custom PMD rule set -->
                        <ruleset>https://raw.githubusercontent.com/wand555/RicherConversation/main/rules.xml</ruleset>
                    </rulesets>
                </configuration>
            </plugin>
            <plugin>
                <!-- The Javadoc plugin uses the Javadoc tool to generate javadocs for the project -->
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <additionalOptions>
                        <option>--show-module-contents all</option>
                        <option>--show-packages all</option>
                    </additionalOptions>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>javadoc</report>
                            <report>test-javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <!-- The JaCoCo plugin runs JaCoCo to compute coverage of the test cases -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.7</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <!-- Disable the JaCoCo Aggregate report by explicitly selecting only the simple report -->
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
                <configuration>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>
</project>
