<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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.baked-libs</groupId>
    <artifactId>dough</artifactId>
    <version>1.1.1</version>

    <packaging>pom</packaging>

    <name>Dough</name>
    <url>https://github.com/baked-libs/dough</url>
    <description>Dough is a powerful library for the everyday Spigot developer</description>

    <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>

        <sonar.projectKey>baked-libs_dough</sonar.projectKey>
        <sonar.organization>baked-libs</sonar.organization>
        <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.log.level>DEBUG</sonar.log.level>
        <sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
    </properties>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/baked-libs/dough/issues</url>
    </issueManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>osshr</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>

        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <scm>
        <connection>scm:git:git://github.com/baked-libs/dough.git</connection>
        <developerConnection>scm:git:ssh://github.com/baked-libs/dough.git</developerConnection>
        <url>https://github.com/baked-libs/dough/tree/main</url>
    </scm>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/baked-libs/dough/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>TheBusyBiscuit</name>
            <url>https://github.com/TheBusyBiscuit</url>
        </developer>
        <developer>
            <name>WalshyDev</name>
            <url>https://github.com/WalshyDev</url>
        </developer>
        <developer>
            <name>md5sha256</name>
            <url>https://github.com/md5sha256</url>
        </developer>
    </developers>

    <modules>
        <!-- Shared base modules -->
        <module>dough-common</module>
        <module>dough-reflection</module>

        <!-- Implementing modules -->
        <module>dough-config</module>
        <module>dough-chat</module>
        <module>dough-data</module>
        <module>dough-skins</module>
        <module>dough-items</module>
        <module>dough-inventories</module>
        <module>dough-protection</module>
        <module>dough-recipes</module>
        <module>dough-updater</module>
        <module>dough-scheduling</module>

        <!-- Aggregating modules -->
        <module>dough-api</module>
    </modules>

    <profiles>
        <profile>
            <id>release</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</version>

                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>package</phase>

                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.3.1</version>

                        <configuration>
                            <includeDependencySources>false</includeDependencySources>

                            <links>
                                <link>https://hub.spigotmc.org/javadocs/spigot/</link>
                            </links>
                        </configuration>

                        <executions>
                            <execution>
                                <id>attach-javadocs</id>

                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>2.5.3</version>

                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <goals>deploy</goals>
                        </configuration>
                    </plugin>

                    <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>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>

                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>

                                <goals>
                                    <goal>sign</goal>
                                </goals>

                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphrase>${gpg.keyname}</passphrase>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>

                <configuration>
                    <excludes>
                        <exclude>**/package-info.java</exclude>
                    </excludes>

                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>

            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>3.9.1.2184</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>

                <configuration>
                    <junitArtifactName>org.junit.jupiter:junit-jupiter</junitArtifactName>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.7</version>

                <executions>
                    <execution>
                        <id>prepare</id>

                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>report</id>
                        <phase>test</phase>

                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>4.2.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.seeseemelk</groupId>
            <artifactId>MockBukkit-v1.18</artifactId>
            <version>1.14.0</version>
            <scope>test</scope>

            <exclusions>
                <exclusion>
                    <groupId>org.jetbrains</groupId>
                    <artifactId>annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</project>
