<!--
  ~ Copyright (c) 2016-2017 Daniel Ennis (Aikar) - MIT License
  ~
  ~  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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.gmcbm.dependencies</groupId>
    <artifactId>acf-parent</artifactId>
    <version>0.5.2</version>
    <packaging>pom</packaging>

    <name>ACF (All)</name>
    <description>Java Command Dispatch Framework - (Bukkit, Spigot, Paper, Sponge, Bungee, JDA, Velocity supported,
        generically usable anywhere)
    </description>
    <url>https://github.com/gmcbm/commands</url>
    <inceptionYear>2015</inceptionYear>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/gmcbm/commands/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/gmcbm/commands.git</connection>
        <developerConnection>scm:git:git@github.com:gmcbm/commands.git</developerConnection>
        <url>https://github.com/gmcbm/commands</url>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/gmcbm/commands/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Jenkins CI</system>
        <url>https://ci.gmcbm.net/job/gmcbm/job/commands/</url>
    </ciManagement>

    <developers>
        <developer>
            <id>aikar</id>
            <name>Daniel Ennis</name>
            <url>https://aikar.co</url>
        </developer>
        <developer>
            <id>ursinn</id>
            <name>Ursin Filli</name>
            <email>ursin.filli@gmcbm.net</email>
            <organization>Global Minecraft Ban Manager</organization>
            <organizationUrl>https://www.gmcbm.net</organizationUrl>
            <timezone>1</timezone>
            <url>https://ursinn.dev</url>
        </developer>
    </developers>

    <organization>
        <name>Global Minecraft Ban Manager</name>
        <url>https://www.gmcbm.net</url>
    </organization>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <ci.build.version>${project.version}</ci.build.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
        <junit.version>5.7.2</junit.version>
        <junit.platform.version>1.4.0</junit.platform.version>
        <mockito.version>3.11.2</mockito.version>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <build>
        <defaultGoal>clean install</defaultGoal>
        <finalName>${project.artifactId}-${ci.build.version}</finalName>
        <plugins>
            <!-- Compiler Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <showDeprecation>false</showDeprecation>
                    <showWarnings>false</showWarnings>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <!-- Surefire Plugin -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
            </plugin>
            <!-- Source Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <minimizeJar>true</minimizeJar>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>net.jodah.expiringmap</pattern>
                            <shadedPattern>co.aikar.commands.lib.expiringmap</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>co.aikar.util</pattern>
                            <shadedPattern>co.aikar.commands.lib.util</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>co.aikar.timings.lib</pattern>
                            <shadedPattern>co.aikar.commands.lib.timings</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
            </plugin>
            <!-- Javadoc Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourcepath>src/main/java</sourcepath>
                    <destDir>../docs/${project.artifactId}/</destDir>
                    <quiet>true</quiet>
                    <detectOfflineLinks>false</detectOfflineLinks>
                    <notimestamp>true</notimestamp>
                    <linksource>true</linksource>
                    <nohelp>true</nohelp>
                    <doclint>none</doclint>
                    <source>8</source>
                </configuration>
            </plugin>
            <!-- Deploy Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Release Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M4</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <scmCommentPrefix xml:space="preserve">[RELEASE] </scmCommentPrefix>
                    <preparationGoals>clean verify</preparationGoals>
                    <completionGoals>clean install</completionGoals>
                    <releaseProfiles>release-sign-artifacts</releaseProfiles>
                    <pushChanges>false</pushChanges>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                </configuration>
            </plugin>
            <!-- Nexus Staging Plugin -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>30.1.1-jre</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>21.0.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <modules>
        <module>core</module>
        <module>brigadier</module>
        <module>bukkit</module>
        <module>paper</module>
        <module>bungee</module>
        <module>sponge</module>
        <module>jda</module>
        <module>velocity</module>
    </modules>

    <profiles>
        <!-- GPG Signature on release -->
        <profile>
            <id>release-sign-artifacts</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jenkins</id>
            <properties>
                <!--suppress UnresolvedMavenProperty -->
                <ci.build.version>
                    ${project.version}-b${env.BUILD_NUMBER}_${env.BRANCH_NAME}
                </ci.build.version>
            </properties>
        </profile>
    </profiles>
</project>
