<?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.disquark</groupId>
    <artifactId>disquark-parent</artifactId>
    <version>0.1.1</version>
    <packaging>pom</packaging>

    <name>DisQuark - Parent</name>
    <description>Reactive library for the Discord API</description>
    <url>https://github.com/cottoncammy/disquark</url>

    <developers>
        <developer>
            <id>cottoncammy</id>
            <name>Cameron Prater</name>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Mozilla Public License 2.0</name>
            <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

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

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/cottoncammy/disquark/issues</url>
    </issueManagement>

    <properties>
        <!-- hack to get properties-maven-plugin to output the project version --> <project.version>${project.version}</project.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.release>11</maven.compiler.release>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <skipITs>true</skipITs>

        <apache-tika.version>2.7.0</apache-tika.version>
        <bouncycastle.version>1.73</bouncycastle.version>
        <bucket4j-version>8.2.0</bucket4j-version>
        <caffeine.version>3.1.6</caffeine.version>
        <immutables.version>2.9.3</immutables.version>
        <jackson.version>2.15.0</jackson.version>
        <jakarta-annotations.version>2.1.1</jakarta-annotations.version>
        <jsr305.version>3.0.2</jsr305.version>
        <junit.version>5.9.3</junit.version>
        <log4j.version>2.20.0</log4j.version>
        <quarkus-ide-config.version>3.0.1.Final</quarkus-ide-config.version>
        <slf4j.version>2.0.7</slf4j.version>
        <smallrye-config.version>3.2.1</smallrye-config.version>
        <smallrye-mutiny.version>2.1.0</smallrye-mutiny.version>
        <smallrye-mutiny-vertx-binding.version>3.3.0</smallrye-mutiny-vertx-binding.version>

        <compiler-plugin.version>3.11.0</compiler-plugin.version>
        <enforcer-plugin.version>3.3.0</enforcer-plugin.version>
        <failsafe-plugin.version>3.0.0</failsafe-plugin.version>
        <formatter-plugin.version>2.22.0</formatter-plugin.version>
        <gpg-plugin.version>3.0.1</gpg-plugin.version>
        <impsort-plugin.version>1.8.0</impsort-plugin.version>
        <install-plugin.version>3.1.1</install-plugin.version>
        <jar-plugin.version>3.3.0</jar-plugin.version>
        <javadoc-plugin.version>3.5.0</javadoc-plugin.version>
        <nexus-staging-plugin.version>1.6.13</nexus-staging-plugin.version>
        <properties-plugin.version>1.1.0</properties-plugin.version>
        <resources-plugin.version>3.3.1</resources-plugin.version>
        <source-plugin.version>3.2.1</source-plugin.version>
        <surefire-plugin.version>${failsafe-plugin.version}</surefire-plugin.version>
        <versions-plugin.version>2.15.0</versions-plugin.version>
    </properties>

    <modules>
        <module>kotlin-parent</module>
        <module>nullable-optional</module>
        <module>immutables</module>
        <module>rest</module>
        <module>integration-tests</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>io.smallrye.reactive</groupId>
                <artifactId>mutiny-bom</artifactId>
                <version>${smallrye-mutiny.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>io.smallrye.reactive</groupId>
                <artifactId>vertx-mutiny-clients-bom</artifactId>
                <version>${smallrye-mutiny-vertx-binding.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>io.disquark.immutables</groupId>
                <artifactId>bom</artifactId>
                <version>${immutables.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>com.bucket4j</groupId>
                <artifactId>bucket4j-core</artifactId>
                <version>${bucket4j-version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.ben-manes.caffeine</groupId>
                <artifactId>caffeine</artifactId>
                <version>${caffeine.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>${jsr305.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.smallrye.config</groupId>
                <artifactId>smallrye-config</artifactId>
                <version>${smallrye-config.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>${jakarta-annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tika</groupId>
                <artifactId>tika-core</artifactId>
                <version>${apache-tika.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk18on</artifactId>
                <version>${bouncycastle.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j2-impl</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</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>

    <build>
        <defaultGoal>clean install</defaultGoal>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${formatter-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>io.quarkus</groupId>
                            <artifactId>quarkus-ide-config</artifactId>
                            <version>${quarkus-ide-config.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <configFile>eclipse-format.xml</configFile>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>${impsort-plugin.version}</version>
                    <configuration>
                        <groups>java.,javax.,com.,io.,org.</groups>
                        <removeUnused>true</removeUnused>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${install-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${jar-plugin.version}</version>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadoc-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <version>${properties-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${source-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${failsafe-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions-plugin.version}</version>
                    <configuration>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-build</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <dependencyConvergence />
                                <requireJavaVersion>
                                    <version>[11,)</version>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>[3.1.0,)</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>check-formatting</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>check-imports</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>format</id>
            <activation>
                <property>
                    <name>skipFormatting</name>
                    <value>!true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>apply-formatting</id>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <properties>
                <skipFormatting>true</skipFormatting>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <defaultGoal>clean deploy</defaultGoal>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>