<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2020-2021 AppsFlyer
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License")
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

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

    <name>Donkey</name>
    <description>Clojure Server and Client</description>
    <groupId>com.appsflyer</groupId>
    <artifactId>donkey</artifactId>
    <version>0.5.2</version>
    <packaging>clojure</packaging>
    <url>https://github.com/AppsFlyer/donkey</url>
    <inceptionYear>2020</inceptionYear>

    <licenses>
        <license>
            <name>APACHE LICENSE, VERSION 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>clojars</id>
            <url>https://repo.clojars.org/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <distributionManagement>
        <repository>
            <id>clojars</id>
            <name>Clojars repository</name>
            <url>https://clojars.org/repo</url>
        </repository>
    </distributionManagement>

    <scm>
        <url>https://github.com/AppsFlyer/donkey</url>
        <connection>scm:git:git://github.com/AppsFlyer/donkey.git</connection>
        <developerConnection>scm:git:https://github.com/AppsFlyer/donkey.git
        </developerConnection>
    </scm>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <vertx.version>4.2.3</vertx.version>
        <netty.version>4.1.72.Final</netty.version>
        <clojure.version>1.10.3</clojure.version>
        <clojure.spec.version>0.3.218</clojure.spec.version>
        <clojure.logging.version>1.2.3</clojure.logging.version>
        <jsonista.version>0.3.5</jsonista.version>
        <slf4j.version>1.7.32</slf4j.version>
        <logback.version>1.2.8</logback.version>
        <junit.version>5.8.2</junit.version>
        <hamcrest.version>2.2</hamcrest.version>
        <mockito.version>3.12.4</mockito.version>
        <ring-core.version>1.9.4</ring-core.version>
        <ring-json.version>0.5.1</ring-json.version>
        <criterium.version>0.4.6</criterium.version>
        <jetbrains.version>20.1.0</jetbrains.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-web</artifactId>
            <version>${vertx.version}</version>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-web-client</artifactId>
            <version>${vertx.version}</version>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-dropwizard-metrics</artifactId>
            <version>${vertx.version}</version>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-junit5</artifactId>
            <version>${vertx.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-epoll</artifactId>
            <version>${netty.version}</version>
            <classifier>linux-x86_64</classifier>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-kqueue</artifactId>
            <version>${netty.version}</version>
        </dependency>
        <dependency>
            <groupId>org.clojure</groupId>
            <artifactId>clojure</artifactId>
            <version>${clojure.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.clojure</groupId>
            <artifactId>spec.alpha</artifactId>
            <version>${clojure.spec.version}</version>
        </dependency>
        <dependency>
            <groupId>metosin</groupId>
            <artifactId>jsonista</artifactId>
            <version>${jsonista.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.clojure</groupId>
            <artifactId>tools.logging</artifactId>
            <version>${clojure.logging.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</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.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>${jetbrains.version}</version>
        </dependency>
        <dependency>
            <groupId>criterium</groupId>
            <artifactId>criterium</artifactId>
            <version>${criterium.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ring</groupId>
            <artifactId>ring-core</artifactId>
            <version>${ring-core.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ring</groupId>
            <artifactId>ring-json</artifactId>
            <version>${ring-json.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <directory>target</directory>
        <outputDirectory>target/classes</outputDirectory>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M5</version>
                    <configuration>
                        <systemPropertyVariables>
                            <io.netty.leakDetectionLevel>PARANOID
                            </io.netty.leakDetectionLevel>
                            <vertx.useNativeTransport>false
                            </vertx.useNativeTransport>
                            <vertx.useDomainSockets>false
                            </vertx.useDomainSockets>
                            <vertx.threadChecks>true</vertx.threadChecks>
                        </systemPropertyVariables>
                        <forkCount>1</forkCount>
                        <reuseForks>true</reuseForks>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <excludes>
                        <exclude>**/logback.xml</exclude>
                        <exclude>coveralls_report.clj</exclude>
                        <exclude>**/public/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.theoryinpractise</groupId>
                <artifactId>clojure-maven-plugin</artifactId>
                <version>1.8.3</version>
                <extensions>true</extensions>
                <configuration>
                    <temporaryOutputDirectory>true</temporaryOutputDirectory>
                    <charset>UTF-8</charset>
                    <warnOnReflection>true</warnOnReflection>
                    <junitOutput>true</junitOutput>
                    <directLinking>true</directLinking>
                </configuration>
                <executions>
                    <execution>
                        <id>junit-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test-with-junit</goal>
                        </goals>
                        <configuration>
                            <testOutputDirectory>target</testOutputDirectory>
                            <warnOnReflection>true</warnOnReflection>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.0.0-M1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <showWarnings>true</showWarnings>
                    <optimize>true</optimize>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${maven.compiler.source}</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>site</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <version>3.7.1</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin
                        </artifactId>
                        <version>3.1.0</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-report-plugin</artifactId>
                        <version>3.0.0-M5</version>
                        <executions>
                            <execution>
                                <phase>site</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdoc</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.2.0</version>
                        <configuration>
                            <reportOutputDirectory>
                                ${project.build.directory}/docs
                            </reportOutputDirectory>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eluder.coveralls</groupId>
                        <artifactId>coveralls-maven-plugin</artifactId>
                        <version>4.3.0</version>
                        <dependencies>
                            <dependency>
                                <groupId>javax.xml.bind</groupId>
                                <artifactId>jaxb-api</artifactId>
                                <version>2.2.3</version>
                            </dependency>
                        </dependencies>
                        <configuration>
                            <!--suppress UnresolvedMavenProperty -->
                            <repoToken>${env.COVERALLS_TOKEN}</repoToken>
                            <coverallsFile>
                                ${project.build.directory}/coveralls/java/coveralls.json
                            </coverallsFile>
                            <failOnServiceError>false</failOnServiceError>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.5</version>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>deploy</id>
            <build>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <excludes>
                            <exclude>**/*</exclude>
                        </excludes>
                        <filtering>false</filtering>
                    </resource>
                </resources>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
