<?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.pinont</groupId>
    <artifactId>singularitylib</artifactId>
    <version>2.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>SingularityLib</name>
    <description>A Library for Minecraft plugin to help developing Minecraft plugin much easier</description>
    <url>https://github.com/Pinont/SingularityLib</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>Pinont</name>
        <url>https://github.com/Pinont</url>
    </organization>

    <developers>
        <developer>
            <id>pinont</id>
            <name>Pinont</name>
            <url>https://github.com/Pinont</url>
            <roles>
                <role>Owner</role>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>

    <profiles>
        <profile>
            <id>with-shade</id>
            <!-- Optional: still allow activation by property 'shade' if you prefer -Dshade=true -->
            <activation>
                <property>
                    <name>shade</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.5.3</version>
                        <configuration>
                            <!-- Attach shaded artifact instead of replacing the main jar -->
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>shaded</shadedClassifierName>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <filters>
                                <filter>
                                    <artifact>org.reflections:reflections</artifact>
                                    <includes>
                                        <include>org/reflections/**</include>
                                    </includes>
                                </filter>
                            </filters>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

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

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/Pinont/SingularityLib/issues</url>
    </issueManagement>

    <properties>
        <java.version>25</java.version>
        <!-- Latest-only Paper 26.2+: resolves to the newest build on repo.papermc.io -->
        <paperapi.version>[26.2.build,)</paperapi.version>
        <!-- Last standalone Folia API line; from Paper 26.x Folia schedulers ship inside paper-api -->
        <foliaapi.version>26.2.build.7-beta</foliaapi.version>
        <!-- MockBukkit artifact matching Paper 26.2 -->
        <mockbukkit.version>4.116.1</mockbukkit.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.release>${java.version}</maven.compiler.release>
    </properties>

    <distributionManagement>
        <repository>
            <id>github</id>
            <name>GitHub Packages (Pinont/SingularityLib)</name>
            <url>https://maven.pkg.github.com/pinont/SingularityLib</url>
        </repository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>papermc</id>
            <url>https://repo.papermc.io/repository/maven-public/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <!-- Compiler -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <release>${maven.compiler.release}</release>
                </configuration>
            </plugin>

            <!-- Resources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.3.1</version>
            </plugin>

            <!-- Sources JAR -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals><goal>jar</goal></goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Javadoc JAR (failOnError=false to avoid build breaks) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.7.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals><goal>jar</goal></goals>
                        <configuration>
                            <failOnError>false</failOnError>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Explicit deploy plugin version -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.2</version>
            </plugin>
        </plugins>

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

    <dependencies>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>${paperapi.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>dev.folia</groupId>
            <artifactId>folia-api</artifactId>
            <version>${foliaapi.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>24.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.10.2</version>
        </dependency>
        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>5.0.0-beta.21</version>
        </dependency>
        <dependency>
            <groupId>org.mockbukkit.mockbukkit</groupId>
            <artifactId>mockbukkit-v26.2</artifactId>
            <version>${mockbukkit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>2.0.16</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>