<?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.freya022</groupId>
    <artifactId>BotCommands</artifactId>
    <!-- major.minor.revision-classifier(_DEV) -->
    <!-- Major for big breaking changes, minor for small breaking changes / possibly features, revision for bugfix/features -->
    <!-- Classifier is optional and can be either alpha or beta -->
    <!-- _DEV is removed by the CI release -->
    <version>3.0.0-alpha.24</version>
    <name>BotCommands</name>

    <description>A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.</description>

    <url>https://github.com/freya022/BotCommands</url>

    <developers>
        <developer>
            <name>freya022</name>
            <email>41875020+freya022@users.noreply.github.com</email>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <kotlin.version>2.1.0</kotlin.version>
        <kotlin.coroutine.version>1.10.1</kotlin.coroutine.version>
        <spring-boot.version>3.4.2</spring-boot.version>
        <flyway.version>11.2.0</flyway.version>
        <bucket4j.version>8.14.0</bucket4j.version>

        <kotlin.compiler.languageVersion>2.0</kotlin.compiler.languageVersion>
        <kotlin.compiler.apiVersion>2.0</kotlin.compiler.apiVersion>
        <kotlin.compiler.jvmTarget>17</kotlin.compiler.jvmTarget>
        <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
    </properties>

    <licenses>
        <license>
            <name>Mozilla Public License 2.0</name>
            <url>https://opensource.org/licenses/MPL-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/freya022/BotCommands.git</connection>
        <developerConnection>scm:git:https://github.com/freya022/BotCommands.git</developerConnection>
        <url>https://github.com/freya022/BotCommands</url>
        <tag>be0fded9aa4b1e416d7a7220b5e2ef6d8cb3c9d2</tag>
    </scm>

    <profiles>
        <profile>
            <id>docs</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <version>1.9.20</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>dokka</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <jdkVersion>17</jdkVersion>
                            <failOnWarning>true</failOnWarning>
                            <sourceLinks>
                                <link>
                                    <path>src</path>
                                    <url>${project.scm.url}/tree/${project.scm.tag}/src</url>
                                    <lineSuffix>#L</lineSuffix>
                                </link>
                            </sourceLinks>
                            <suppressedFiles>${project.basedir}/src/main/java/io/github/freya022/botcommands/api/$BCInfo.java</suppressedFiles>
                            <sourceDirectories>
                                <dir>${project.basedir}/src/main/java</dir>
                                <dir>${project.build.directory}/generated-sources</dir>
                                <dir>${project.basedir}/src/main/kotlin</dir>
                            </sourceDirectories>
                            <externalDocumentationLinks>
                                <link>
                                    <url>https://docs.jda.wiki/</url>
                                    <packageListUrl>https://docs.jda.wiki/element-list</packageListUrl>
                                </link>
                                <link>
                                    <url>https://javadoc.io/doc/org.jetbrains/annotations/23.0.0</url>
                                    <packageListUrl>https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/element-list</packageListUrl>
                                </link>
                                <link>
                                    <url>https://docs.spring.io/spring-framework/docs/current/javadoc-api</url>
                                    <packageListUrl>https://docs.spring.io/spring-framework/docs/current/javadoc-api/element-list</packageListUrl>
                                </link>
                                <link>
                                    <url>https://javadoc.io/doc/com.bucket4j/bucket4j_jdk17-core/${bucket4j.version}</url>
                                    <packageListUrl>https://javadoc.io/doc/com.bucket4j/bucket4j_jdk17-core/${bucket4j.version}/element-list</packageListUrl>
                                </link>
                            </externalDocumentationLinks>
                            <perPackageOptions>
                                <packageOptions>
                                    <matchingRegex>.*internal.*</matchingRegex>
                                    <suppress>true</suppress>
                                </packageOptions>
                            </perPackageOptions>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>3.4.1</version>
                        <executions>
                            <execution>
                                <id>enforce-all-profiles-are-activated</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireActiveProfile>
                                            <profiles>docs</profiles> <!-- Run dokka -->
                                        </requireActiveProfile>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>3.3.0</version>
                        <configuration>
                            <archive>
                                <manifestEntries>
                                    <Built-By>freya02</Built-By>
                                </manifestEntries>
                            </archive>
                        </configuration>
                        <executions>
                            <execution>
                                <id>dokka-jar</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>javadoc</classifier>
                                    <classesDirectory>${project.build.directory}/dokka</classesDirectory>
                                    <skipIfEmpty>false</skipIfEmpty>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.4</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Update plugin versions -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-install-plugin</artifactId>
                        <version>3.1.1</version>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6.3</version>
                                </requireMavenVersion>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.github.freya022</groupId>
                <artifactId>BotCommandsBuild-maven-plugin</artifactId>
                <version>01a97655cd</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate-version-info</goal>
                            <goal>generate-configuration-metadata</goal>
                            <goal>check-ci-version</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourceDirs>
                        <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                    </sourceDirs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <configuration>
                    <args>
                        <arg>-Xjvm-default=all</arg>
                        <arg>-Xcontext-receivers</arg>
                        <arg>-Xsuppress-warning=CONTEXT_RECEIVERS_DEPRECATED</arg>
                        <arg>-Xconsistent-data-class-copy-visibility</arg>
                    </args>
                </configuration>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/main/java</sourceDir>
                                <!-- Needed for BC generated sources -->
                                <sourceDir>${project.build.directory}/generated-sources</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/test/java</sourceDir>
                                <!-- Examples -->
                                <sourceDir>${project.basedir}/src/examples/kotlin</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.12.1</version>
                <configuration>
                    <release>17</release>
                    <compilerArgs>
                        <compilerArg>-parameters</compilerArg>
                    </compilerArgs>
                    <excludes>
                        <exclude>io/github/freya022/botcommands/api/$BCInfo.java</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <!-- Replacing default-compile as it is treated specially by maven -->
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <!-- Replacing default-testCompile as it is treated specially by maven -->
                    <execution>
                        <id>default-testCompile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>java-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>java-test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId> <!-- Fixes including kotlin and generated sources -->
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/kotlin</source>
                                <!-- Somehow fixes maven taking already compiled classes (by IJ) into the final JAR -->
                                <source>${project.build.directory}/generated-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>examples-test-sources</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/examples/kotlin</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>examples-test-resources</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>add-test-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/examples/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                        <configuration>
                            <excludes>io/github/freya022/botcommands/api/$BCInfo.java</excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.5</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.16.2</version>
                <configuration>
                    <rulesUri>file:///${project.basedir}/rules.xml</rulesUri>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <pluginRepositories>
        <pluginRepository>
            <id>jitpack</id>
            <url>https://jitpack.io</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <version>${spring-boot.version}</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlinx</groupId>
            <artifactId>kotlinx-coroutines-core</artifactId>
            <version>${kotlin.coroutine.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlinx</groupId>
            <artifactId>kotlinx-coroutines-debug</artifactId>
            <version>${kotlin.coroutine.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlinx</groupId>
            <artifactId>kotlinx-datetime-jvm</artifactId>
            <version>0.6.1</version>
        </dependency>
        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>5.3.0</version>
            <exclusions>
                <exclusion>
                    <groupId>club.minnced</groupId>
                    <artifactId>opus-java</artifactId>
                </exclusion>
            </exclusions>
            <scope>provided</scope>
        </dependency>
        <!-- Include it again as JDA has it on the "runtime" scope -->
        <!-- Match JDA's version to avoid the bot exploding with NoSuchClass/MethodError -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.17.2</version>
        </dependency>
        <dependency>
            <groupId>club.minnced</groupId>
            <artifactId>jda-ktx</artifactId>
            <version>0.12.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>
        <dependency>
            <groupId>net.fellbaum</groupId>
            <artifactId>jemoji</artifactId>
            <version>1.6.0</version>
        </dependency>
        <dependency>
            <groupId>dev.freya02</groupId>
            <artifactId>jda-emojis</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>24.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.github.classgraph</groupId>
            <artifactId>classgraph</artifactId>
            <version>4.8.179</version>
        </dependency>
        <dependency>
            <groupId>net.sf.trove4j</groupId>
            <artifactId>core</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
            <version>3.2.0</version>
        </dependency>
        <dependency>
            <groupId>info.debatty</groupId>
            <artifactId>java-string-similarity</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.16</version>
        </dependency>
        <dependency>
            <groupId>io.github.oshai</groupId>
            <artifactId>kotlin-logging-jvm</artifactId>
            <version>7.0.3</version>
        </dependency>
        <dependency>
            <groupId>com.bucket4j</groupId>
            <artifactId>bucket4j_jdk17-core</artifactId>
            <version>${bucket4j.version}</version>
        </dependency>
        <dependency>
            <groupId>com.bucket4j</groupId>
            <artifactId>bucket4j_jdk17-postgresql</artifactId>
            <version>${bucket4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>dev.reformator.stacktracedecoroutinator</groupId>
            <artifactId>stacktrace-decoroutinator-jvm</artifactId>
            <version>2.4.8</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>${spring-boot.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.5.16</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.7.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>2.3.232</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <version>${flyway.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency> <!-- https://github.com/flyway/flyway/issues/3780 -->
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-database-postgresql</artifactId>
            <version>${flyway.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>6.2.1</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <version>2.17.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.11.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.mockk</groupId>
            <artifactId>mockk-jvm</artifactId>
            <version>1.13.16</version>
            <scope>test</scope>
        </dependency>
        <dependency> <!-- Upgrade because kotlinx-coroutines-debug somehow has an ANCIENT version -->
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy</artifactId>
            <version>1.16.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy-agent</artifactId>
            <version>1.16.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-metadata-jvm</artifactId>
            <version>${kotlin.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
