<?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>com.github.ocraft</groupId>
    <artifactId>ocraft-s2client</artifactId>
    <packaging>pom</packaging>
    <version>0.4.13</version>

    <modules>
        <module>ocraft-s2client-test</module>
        <module>ocraft-s2client-protocol</module>
        <module>ocraft-s2client-api</module>
        <module>ocraft-s2client-bot</module>
        <module>ocraft-s2client-benchmark</module>
        <module>ocraft-s2client-sample</module>
    </modules>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>
        StarCraft II Client - Java library supported on Windows, Linux and Mac designed for building scripted bots and
        research using the SC2API.
    </description>
    <url>https://github.com/ocraft/ocraft-s2client</url>
    <inceptionYear>2017</inceptionYear>

    <organization>
        <name>Ocraft Project</name>
        <url>https://github.com/ocraft</url>
    </organization>

    <licenses>
        <license>
            <name>The MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Piotr Picheta</name>
            <url>https://discord.gg/qTZ65sh</url>
            <email>ocraftproject@gmail.com</email>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <scm>
        <connection>scm:git:https://github.com/ocraft/ocraft-s2client.git</connection>
        <url>https://github.com/ocraft/ocraft-s2client</url>
        <developerConnection>scm:git:https://github.com/ocraft/ocraft-s2client.git</developerConnection>
        <tag>v0.4.13</tag>
    </scm>

    <properties>
        <user.name>Ocraft Project</user.name>

        <github.global.server>github</github.global.server>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <maven.compiler.source>1.9</maven.compiler.source>
        <maven.compiler.target>1.9</maven.compiler.target>

        <test.integration.skip>true</test.integration.skip>
        <test.integration.groups />

        <version.protobuf>3.7.1</version.protobuf>
        <version.vertx>3.7.0</version.vertx>
        <version.javassist>3.23.1-GA</version.javassist>
        <version.slf4j>1.7.30</version.slf4j>
        <version.log4j>2.13.3</version.log4j>
        <version.fasterxml>2.11.1</version.fasterxml>
        <version.config>1.3.3</version.config>
        <version.cli>3.7.0</version.cli>

        <version.jmh>1.21</version.jmh>

        <version.junit-platform>1.3.1</version.junit-platform>
        <version.junit-jupiter>5.3.1</version.junit-jupiter>
        <version.mockito>3.3.3</version.mockito>
        <version.assertj>3.11.1</version.assertj>
        <version.equalsverifier>3.0.2</version.equalsverifier>
        <version.objectdiff>0.95</version.objectdiff>
        <version.awaitility>1.7.0</version.awaitility>

        <version.plugin.surefire>2.22.0</version.plugin.surefire>
        <version.plugin.filesafe>2.22.0</version.plugin.filesafe>
        <version.plugin.jacoco>0.8.2</version.plugin.jacoco>
        <version.plugin.protobuf>0.5.1</version.plugin.protobuf>
        <version.plugin.build-helper>3.0.0</version.plugin.build-helper>
        <version.plugin.compiler>3.8.0</version.plugin.compiler>
        <version.plugin.os>1.6.0</version.plugin.os>
        <version.plugin.jar>3.1.0</version.plugin.jar>
        <version.plugin.source>3.0.1</version.plugin.source>
        <version.plugin.javadoc>3.0.1</version.plugin.javadoc>
        <version.plugin.gpg>1.6</version.plugin.gpg>
        <version.plugin.staging>1.6.8</version.plugin.staging>
        <version.plugin.release>3.0.0-M4</version.plugin.release>
        <version.plugin.license>1.16</version.plugin.license>
        <version.plugin.asciidoctor>1.5.6</version.plugin.asciidoctor>
        <version.plugin.ghpage>0.12</version.plugin.ghpage>

    </properties>

    <profiles>
        <profile>
            <id>INTEGRATION_TEST</id>
            <properties>
                <test.integration.skip>false</test.integration.skip>
                <test.integration.groups>integration</test.integration.groups>
            </properties>
        </profile>

        <profile>
            <id>END_TO_END_TEST</id>
            <properties>
                <test.integration.skip>false</test.integration.skip>
                <test.integration.groups>integration,endtoend</test.integration.groups>
            </properties>
        </profile>

        <profile>
            <id>RELEASE</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.plugin.source}</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-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.plugin.gpg}</version>
                        <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>
                        <version>${version.plugin.staging}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>


                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>${version.plugin.release}</version>
                        <configuration>
                            <tagNameFormat>v@{project.version}</tagNameFormat>
                            <localCheckout>true</localCheckout>
                            <pushChanges>false</pushChanges>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <id>DOC</id>

            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>

                    <plugin>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctor-maven-plugin</artifactId>
                    </plugin>

                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>site-maven-plugin</artifactId>
                        <version>${version.plugin.ghpage}</version>
                        <inherited>false</inherited>
                        <configuration>
                            <message>Creating site for ${project.version}</message>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>site</goal>
                                </goals>
                                <phase>site</phase>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencyManagement>
        <dependencies>

            <!-- ocraft-s2client -->
            <dependency>
                <groupId>com.github.ocraft</groupId>
                <artifactId>ocraft-s2client-test</artifactId>
                <version>${project.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.github.ocraft</groupId>
                <artifactId>ocraft-s2client-protocol</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.ocraft</groupId>
                <artifactId>ocraft-s2client-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.ocraft</groupId>
                <artifactId>ocraft-s2client-bot</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- protobuf -->
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${version.protobuf}</version>
            </dependency>

            <!-- vertx -->
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-web-client</artifactId>
                <version>${version.vertx}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-rx-java2</artifactId>
                <version>${version.vertx}</version>
            </dependency>
            <dependency>
                <groupId>org.javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>${version.javassist}</version>
            </dependency>

            <!-- log4j -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${version.log4j}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${version.log4j}</version>
            </dependency>

            <!-- jmh -->
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-core</artifactId>
                <version>${version.jmh}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-generator-annprocess</artifactId>
                <version>${version.jmh}</version>
            </dependency>

            <!-- fasterxml -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${version.fasterxml}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jdk8</artifactId>
                <version>${version.fasterxml}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${version.fasterxml}</version>
            </dependency>

            <!-- config -->
            <dependency>
                <groupId>com.typesafe</groupId>
                <artifactId>config</artifactId>
                <version>${version.config}</version>
            </dependency>
            <dependency>
                <groupId>info.picocli</groupId>
                <artifactId>picocli</artifactId>
                <version>${version.cli}</version>
            </dependency>

            <!-- test -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${version.junit-jupiter}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${version.junit-jupiter}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${version.junit-jupiter}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${version.mockito}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${version.assertj}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>nl.jqno.equalsverifier</groupId>
                <artifactId>equalsverifier</artifactId>
                <version>${version.equalsverifier}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>de.danielbechler</groupId>
                <artifactId>java-object-diff</artifactId>
                <version>${version.objectdiff}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.jayway.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${version.awaitility}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>${version.plugin.os}</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.xolstice.maven.plugins</groupId>
                    <artifactId>protobuf-maven-plugin</artifactId>
                    <version>${version.plugin.protobuf}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${version.plugin.build-helper}</version>
                    <executions>
                        <execution>
                            <id>add-classes</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${version.plugin.license}</version>
                    <configuration>
                        <licenseName>mit</licenseName>
                        <trimHeaderLine>true</trimHeaderLine>
                    </configuration>
                    <executions>
                        <execution>
                            <id>first</id>
                            <goals>
                                <goal>update-file-header</goal>
                                <goal>update-project-license</goal>
                            </goals>
                            <phase>process-sources</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${version.plugin.javadoc}</version>
                    <configuration>
                        <excludePackageNames>SC2APIProtocol</excludePackageNames>
                    </configuration>
                    <executions>
                        <execution>
                            <id>aggregate</id>
                            <goals>
                                <goal>aggregate</goal>
                            </goals>
                            <phase>site</phase>
                            <configuration>
                                <outputDirectory>${project.reporting.outputDirectory}/apidocs</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>${version.plugin.asciidoctor}</version>
                    <inherited>false</inherited>
                    <executions>
                        <execution>
                            <id>output-html</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>process-asciidoc</goal>
                            </goals>
                            <configuration>
                                <sourceDirectory>docs</sourceDirectory>
                                <outputDirectory>${project.build.directory}/site</outputDirectory>
                                <preserveDirectories>true</preserveDirectories>
                                <sourceHighlighter>coderay</sourceHighlighter>
                                <backend>html5</backend>
                                <doctype>docbook</doctype>
                                <attributes>
                                    <toc>left</toc>
                                </attributes>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.plugin.compiler}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.plugin.surefire}</version>
                <configuration>
                    <argLine>-Xmx1024m</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${version.plugin.filesafe}</version>
                <configuration>
                    <skipTests>${test.integration.skip}</skipTests>
                    <groups>${test.integration.groups}</groups>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${version.plugin.jacoco}</version>
                <configuration>
                    <append>true</append>
                </configuration>
                <executions>
                    <execution>
                        <id>agent-for-ut</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>agent-for-it</id>
                        <goals>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-site-ut</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-site-it</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>report-integration</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${version.plugin.jar}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Built-By>Ocraft Project</Built-By>
                        </manifestEntries>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>