<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>

    <!-- Maven coordinates -->
    <groupId>com.nukkitx</groupId>
    <artifactId>nukkitx-parent</artifactId>
    <version>1.5.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>

    <!-- Project information -->
    <name>NukkitX Parent</name>
    <description>Nuclear-Powered Server Software for Minecraft: Bedrock Edition.</description>
    <url>https://github.com/NukkitX/Nukkit</url>
    <inceptionYear>2017</inceptionYear>
    <licenses>
        <license>
            <name>GNU General Public License v3</name>
            <url>https://opensource.org/licenses/LGPL-3.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <organization>
        <name>NukkitX</name>
        <url>https://github.com/NukkitX</url>
    </organization>

    <!-- Project modules -->
    <modules>
        <module>message</module>
        <module>api</module>
        <module>console</module>
        <module>nbt</module>
        <module>server</module>
        <module>bootstrap</module>
    </modules>

    <!-- Environment settings -->
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/NukkitX/Nukkit/issues</url>
    </issueManagement>
    <ciManagement>
        <system>Jenkins</system>
        <url>https://ci.nukkitx.com/job/NukkitX/</url>
    </ciManagement>
    <scm>
        <connection>scm:git:https://github.com/NukkitX/Nukkit.git</connection>
        <developerConnection>scm:git:git@github.com:NukkitX/Nukkit.git</developerConnection>
        <url>https://github.com/NukkitX/Nukkit</url>
    </scm>
    <distributionManagement>
        <repository>
            <id>releases</id>
            <name>nukkitx-releases</name>
            <url>https://repo.nukkitx.com/release</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>nukkitx-snapshots</name>
            <url>https://repo.nukkitx.com/snapshot</url>
        </snapshotRepository>
    </distributionManagement>

    <!-- Build properties -->
    <properties>
        <!-- Common build properties -->
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>HHmm-ddMMyyyy</maven.build.timestamp.format>

        <!-- Common library versions -->
        <api.version>2.0.0-SNAPSHOT</api.version>
        <netty.version>4.1.24.Final</netty.version>
    </properties>

    <!-- Custom repositories -->
    <repositories>
        <repository>
            <id>nukkitx-repo-release</id>
            <url>https://repo.nukkitx.com/release/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>nukkitx-repo-snapshot</id>
            <url>https://repo.nukkitx.com/snapshot/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <!-- Common dependencies -->
    <dependencies>
        <!-- Annotations -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.20</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
            <scope>provided</scope>
        </dependency>
        <!-- Unit testing -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>25.0-jre</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- Common build lifecycle -->
    <build>
        <defaultGoal>clean package</defaultGoal>
        <!-- Include resources if present -->
        <resources>
            <resource>
                <directory>src/main/resources/</directory>
                <!-- Filter variables inside resources -->
                <filtering>true</filtering>
            </resource>
        </resources>
        <!-- Override plugin versions, use latest releases -->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.0.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
        </plugins>
        <!-- Define module common plugins -->
        <pluginManagement>
            <plugins>
                <!-- JRebel report -->
                <plugin>
                    <groupId>org.zeroturnaround</groupId>
                    <artifactId>jrebel-maven-plugin</artifactId>
                    <version>1.1.8</version>
                    <executions>
                        <execution>
                            <id>generate-rebel-xml</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
