<?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>
    <properties>
        <project.jdk.version>8</project.jdk.version>
        <maven.compiler.source>${project.jdk.version}</maven.compiler.source>
        <maven.compiler.target>${project.jdk.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>

        <deps.configured.version>4.1.5</deps.configured.version>
        <deps.yamlcommentwriter.version>1.2.1</deps.yamlcommentwriter.version>
        <deps.easyplugin.version>1.5.12</deps.easyplugin.version>
    </properties>

    <groupId>cc.carm.lib</groupId>
    <artifactId>mineconfiguration-parent</artifactId>
    <version>3.1.3</version>
    <packaging>pom</packaging>
    <modules>
        <module>common</module>
        <module>platform/bukkit</module>
        <module>platform/bungee</module>
        <module>platform/velocity</module>
    </modules>

    <name>MineConfiguration</name>
    <description>EasyConfiguration for MineCraft.</description>
    <url>https://github.com/CarmJos/MineConfiguration</url>

    <developers>
        <developer>
            <id>CarmJos</id>
            <name>Carm Jos</name>
            <email>carm@carm.cc</email>
            <url>https://www.carm.cc</url>
            <timezone>Asia/Shanghai</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:CarmJos/MineConfiguration</connection>
        <developerConnection>scm:git:git@github.com:CarmJos/MineConfiguration.git</developerConnection>
        <url>https://github.com/CarmJos/MineConfiguration</url>
        <tag>HEAD</tag>
    </scm>

    <licenses>
        <license>
            <name>GNU LESSER GENERAL PUBLIC LICENSE</name>
            <url>https://www.gnu.org/licenses/lgpl-3.0.html</url>
        </license>
    </licenses>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/CarmJos/MineConfiguration/issues</url>
    </issueManagement>

    <ciManagement>
        <system>GitHub Actions</system>
        <url>https://github.com/CarmJos/MineConfiguration/actions/workflows/maven.yml</url>
    </ciManagement>

    <repositories>

        <repository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2/</url>
        </repository>

        <repository>
            <id>sonatype</id>
            <url>https://s01.oss.sonatype.org/content/groups/public/</url>
        </repository>

        <repository>
            <id>minebench-repo</id>
            <url>https://repo.minebench.de/</url>
        </repository>

        <repository>
            <id>papermc</id>
            <url>https://repo.papermc.io/repository/maven-public/</url>
        </repository>

        <repository>
            <id>lumine</id>
            <url>https://mvn.lumine.io/repository/maven-public/</url>
        </repository>

    </repositories>

    <distributionManagement>
        <downloadUrl>https://github.com/CarmJos/MineConfiguration/releases</downloadUrl>
    </distributionManagement>

    <dependencies>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>26.0.2</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>


    <build>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.3</version>
                <configuration>
                    <useSystemClassLoader>false</useSystemClassLoader>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.7</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.0</version>
                <configuration>
                    <source>${project.jdk.version}</source>
                    <target>${project.jdk.version}</target>
                    <encoding>UTF-8</encoding>
                    <compilerArgument>-parameters</compilerArgument>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.11.2</version>
                    <configuration>
                        <classifier>javadoc</classifier>
                        <detectJavaApiLink>false</detectJavaApiLink>
                        <encoding>UTF-8</encoding>
                        <charset>UTF-8</charset>
                        <docencoding>UTF-8</docencoding>
                        <locale>zh_CN</locale>
                        <includeDependencySources>true</includeDependencySources>
                        <dependencySourceIncludes>
                            <dependencySourceInclude>cc.carm.lib:*</dependencySourceInclude>
                        </dependencySourceIncludes>
                        <additionalOptions>
                            <additionalOption>-Xdoclint:none</additionalOption>
                        </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-shade-plugin</artifactId>
                    <version>3.6.0</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <createDependencyReducedPom>false</createDependencyReducedPom>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/MANIFEST.MF</exclude>
                                    <exclude>META-INF/*.txt</exclude>
                                </excludes>
                            </filter>
                        </filters>
                    </configuration>
                </plugin>


            </plugins>
        </pluginManagement>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

    </build>

    <profiles>

        <profile>
            <id>central</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.7.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>github</id>
            <distributionManagement>
                <repository>
                    <id>github</id>
                    <name>GitHub Packages</name>
                    <url>https://maven.pkg.github.com/CarmJos/MineConfiguration</url>
                </repository>
            </distributionManagement>
        </profile>


    </profiles>

</project>
