<?xml version="1.0" encoding="UTF-8"?>
<!--

    The MIT License
    Copyright © 2023 Loïc DUBOIS-TERMOZ (alias Djaytan)

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.

-->
<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>com.djaytan.bukkit</groupId>
    <artifactId>bukkit-slf4j</artifactId>
    <version>2.0.0</version>
    <packaging>jar</packaging>

    <name>Bukkit SLF4J</name>
    <description>The SLF4J implementation for Bukkit</description>

    <properties>
        <!-- ==================== General ==================== -->
        <project.encoding>UTF-8</project.encoding>
        <project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${project.encoding}</project.reporting.outputEncoding>
        <java.version>17</java.version>

        <!-- Default properties -->
        <format.perform.skip>false</format.perform.skip>
        <format.check.skip>true</format.check.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.12</version>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>clean install</defaultGoal>

        <pluginManagement>
            <plugins>
                <!-- Basic Maven plugins -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.3.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.12.1</version>
                    <configuration>
                        <release>${java.version}</release>
                        <failOnWarning>true</failOnWarning>
                        <showDeprecation>true</showDeprecation>
                        <compilerArgs>
                            <arg>-Xlint:all</arg>
                            <arg>-Xlint:-exports</arg>
                            <arg>-Xlint:-requires-automatic</arg>
                            <arg>-Xlint:-requires-transitive-automatic</arg>
                            <arg>-Xlint:-serial</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>

                <!-- Formatting-related plugins -->
                <plugin>
                    <groupId>com.github.ekryd.sortpom</groupId>
                    <artifactId>sortpom-maven-plugin</artifactId>
                    <version>3.3.0</version>
                    <configuration>
                        <!-- General properties -->
                        <createBackupFile>false</createBackupFile>
                        <encoding>${project.encoding}</encoding>

                        <!-- Formatting properties -->
                        <expandEmptyElements>false</expandEmptyElements>
                        <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
                        <lineSeparator>\n</lineSeparator>
                        <nrOfIndentSpace>4</nrOfIndentSpace>
                        <ignoreLineSeparators>false</ignoreLineSeparators>

                        <!-- Sorting properties -->
                        <predefinedSortOrder>custom_1</predefinedSortOrder>
                        <sortModules>true</sortModules>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.spotify.fmt</groupId>
                    <artifactId>fmt-maven-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>4.3</version>
                    <configuration>
                        <properties>
                            <owner>Loïc DUBOIS-TERMOZ (alias Djaytan)</owner>
                        </properties>
                        <licenseSets>
                            <licenseSet>
                                <header>com/mycila/maven/plugin/license/templates/MIT.txt</header>
                                <excludes>
                                    <exclude>src/main/resources/**</exclude>
                                    <exclude>src/test/resources/**</exclude>
                                    <exclude>scripts/**</exclude>
                                    <exclude>.editorconfig</exclude>
                                    <exclude>release.config.js</exclude>
                                    <exclude>jitpack.yml</exclude>
                                </excludes>
                            </licenseSet>
                        </licenseSets>
                    </configuration>
                </plugin>

                <!-- Enforcement-related plugins -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.6.1</version>
                    <configuration>
                        <failBuild>true</failBuild>
                        <failOnWarning>true</failOnWarning>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.4.1</version>
                    <configuration>
                        <fail>true</fail>
                        <failFast>true</failFast>
                        <rules>
                            <banDuplicatePomDependencyVersions />
                            <dependencyConvergence />
                            <reactorModuleConvergence />
                            <requireJavaVersion>
                                <version>[17,)</version>
                            </requireJavaVersion>
                            <requireMavenVersion>
                                <version>[3.8,)</version>
                            </requireMavenVersion>
                            <requirePluginVersions>
                                <message>Best Practice is to always define plugin versions!</message>
                                <!-- "site" phase is not applicable for this project -->
                                <unCheckedPluginList>org.apache.maven.plugins:maven-site-plugin</unCheckedPluginList>
                            </requirePluginVersions>
                            <requireUpperBoundDeps />
                        </rules>
                    </configuration>
                </plugin>

                <!-- Test-related plugins -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                    <configuration>
                        <argLine>@{argLine} -Xshare:off</argLine>
                        <parallel>all</parallel>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.11</version>
                </plugin>

                <!-- Release-related plugins -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.16.2</version>
                    <configuration>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.6.0</version>
                    <configuration>
                        <quiet>true</quiet>
                        <additionalJOptions>
                            <additionalJOption>-Xdoclint:all,-html</additionalJOption>
                        </additionalJOptions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <!-- SonarCloud code quality scans -->
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>3.10.0.2594</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- Formatting-related plugins -->
            <plugin>
                <groupId>com.github.ekryd.sortpom</groupId>
                <artifactId>sortpom-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>format</id>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                        <configuration>
                            <skip>${format.perform.skip}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>check</id>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                        <!-- Force "validate" phase to raise error as early as possible -->
                        <phase>validate</phase>
                        <configuration>
                            <skip>${format.check.skip}</skip>
                            <verifyFail>Stop</verifyFail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.spotify.fmt</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>format</id>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <configuration>
                            <skip>${format.perform.skip}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <!-- Force "validate" phase to raise error as early as possible -->
                        <phase>validate</phase>
                        <configuration>
                            <skip>${format.check.skip}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>format</id>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <!-- Required since plugin is not hooked to any lifecycle phase by default -->
                        <phase>process-sources</phase>
                        <configuration>
                            <skip>${format.perform.skip}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <!-- Force "validate" phase to raise error as early as possible -->
                        <phase>validate</phase>
                        <configuration>
                            <failIfMissing>true</failIfMissing>
                            <failIfUnknown>true</failIfUnknown>
                            <skip>${format.check.skip}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Enforcement-related plugins -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>analyze-only</goal>
                            <goal>analyze-dep-mgt</goal>
                            <goal>analyze-duplicate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Test-related plugins -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <url>https://github.com/Djaytan/bukkit-slf4j</url>
    <inceptionYear>2023</inceptionYear>

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

    <developers>
        <developer>
            <name>Loïc DUBOIS-TERMOZ (alias Djaytan)</name>
            <email>26904516+Djaytan@users.noreply.github.com</email>
            <organization>Djaytan</organization>
            <organizationUrl>https://github.com/Djaytan/bukkit-slf4j</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:${project.scm.url}</connection>
        <developerConnection>scm:git:${project.scm.url}</developerConnection>
        <url>git@github.com:Djaytan/bukkit-slf4j.git</url>
    </scm>

    <issueManagement>
        <url>https://github.com/Djaytan/bukkit-slf4j/issues</url>
    </issueManagement>

    <ciManagement>
        <url>https://github.com/Djaytan/bukkit-slf4j/actions</url>
    </ciManagement>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>ci</id>
            <properties>
                <format.perform.skip>true</format.perform.skip>
                <format.check.skip>false</format.check.skip>
            </properties>
        </profile>
        <profile>
            <id>fast</id>
            <properties>
                <format.perform.skip>true</format.perform.skip>
                <format.check.skip>true</format.check.skip>
                <enforcer.skip>true</enforcer.skip>
                <jacoco.skip>true</jacoco.skip>
                <mdep.analyze.skip>true</mdep.analyze.skip>
                <skipTests>true</skipTests>
                <maven.test.skip>true</maven.test.skip>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
