<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2020 Zeppelin Bend Pty Ltd
  ~
  ~ This Source Code Form is subject to the terms of the Mozilla Public
  ~ License, v. 2.0. If a copy of the MPL was not distributed with this
  ~ file, You can obtain one at https://mozilla.org/MPL/2.0/.
  -->
<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.zepben.maven</groupId>
    <artifactId>evolve-super-pom</artifactId>
    <!-- Version should not be set to snapshot as CI expects finalized version -->
    <version>0.22.0</version>

    <packaging>pom</packaging>
    <name>${project.groupId}:${project.artifactId}</name>
    <description>Super Pom for Evolve Maven projects. Used for version management within the evolve platform.</description>
    <url>https://github.com/zepben/evolve-super-pom/</url>
    <organization>
        <name>Zeppelin Bend Pty Ltd.</name>
        <url>https://zepben.com</url>
    </organization>

    <licenses>
        <license>
            <name>Mozilla Public License v2.0</name>
            <url>https://mozilla.org/MPL/2.0/</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Anthony Charlton</name>
            <email>anthony.charlton@zepben.com</email>
            <organization>Zeppelin Bend</organization>
            <organizationUrl>https://zepben.com</organizationUrl>
        </developer>
        <developer>
            <name>Glenn Carwardine</name>
            <email>glenn.carwardine@zepben.com</email>
            <organization>Zeppelin Bend</organization>
            <organizationUrl>https://zepben.com</organizationUrl>
        </developer>
        <developer>
            <name>Kurt Greaves</name>
            <email>kurt.greaves@zepben.com</email>
            <organization>Zeppelin Bend</organization>
            <organizationUrl>https://zepben.com</organizationUrl>
        </developer>
        <developer>
            <name>Marcus Koh</name>
            <email>marcus.koh@zepben.com</email>
            <organization>Zeppelin Bend</organization>
            <organizationUrl>https://zepben.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/zepben/evolve-super-pom.git</connection>
        <developerConnection>scm:git:ssh://github.com/zepben/evolve-super-pom.git</developerConnection>
        <url>https://github.com/zepben/evolve-super-pom/src</url>
    </scm>

    <properties>
        <maven.compiler.release>11</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <mainClass>define.in.your.child.pom.for.shading</mainClass>

        <autovalue.version>1.7</autovalue.version>
        <slf4j.version>1.7.24</slf4j.version>
        <vertx.version>3.9.6</vertx.version>

        <junit-jupiter.version>5.5.2</junit-jupiter.version>
        <mockito.version>3.12.4</mockito.version>
        <mockito.kotlin.version>3.2.0</mockito.kotlin.version>
        <hamcrest.version>2.2</hamcrest.version>
        <graphql-kotlin.version>5.4.0</graphql-kotlin.version>
        <jetbrains.exposed.version>0.38.2</jetbrains.exposed.version>

        <!-- protobuf options -->
        <protobuf.version>3.17.3</protobuf.version>
        <protobuf.plugin.version>3.11.4</protobuf.plugin.version>
        <grpc.version>1.40.0</grpc.version>

        <!-- Kotlin options -->
        <kotlin.version>1.5.31</kotlin.version>
        <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
        <kotlin.coroutines.version>1.5.2</kotlin.coroutines.version>
        <kotlin.code.style>official</kotlin.code.style>
        <kotlin.language.version>1.5</kotlin.language.version>
        <kotlin.serialization.version>1.3.0</kotlin.serialization.version>

        <!-- jacoco options -->
        <jacoco.version>0.8.7</jacoco.version>
        <jacoco.coverage>0.8</jacoco.coverage>
        <jacoco.ut.execution.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.ut.execution.data.file>
        <jacoco.it.execution.data.file>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco.it.execution.data.file>
        <skip.unit.tests>false</skip.unit.tests>
        <skip.integration.tests>true</skip.integration.tests>

        <!-- azure sdk -->
        <azure.bom.version>1.0.5</azure.bom.version>

        <dokka.version>1.4.10</dokka.version>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
    <pluginRepositories>
        <pluginRepository>
            <id>jcenter</id>
            <name>JCenter</name>
            <url>https://jcenter.bintray.com/</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.intellij</groupId>
                <artifactId>annotations</artifactId>
                <version>12.0</version>
            </dependency>

            <!-- Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>1.2.1</version>
            </dependency>
            <dependency>
                <groupId>org.fusesource.jansi</groupId>
                <artifactId>jansi</artifactId>
                <version>1.18</version>
            </dependency>

            <!-- Kotlin -->
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-core</artifactId>
                <version>${kotlin.coroutines.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-reflect</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-serialization-json</artifactId>
                <version>${kotlin.serialization.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test-junit</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito.kotlin</groupId>
                <artifactId>mockito-kotlin</artifactId>
                <version>${mockito.kotlin.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-inline</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.marcinziolo</groupId>
                <artifactId>kotlin-wiremock</artifactId>
                <version>1.0.1</version>
                <scope>test</scope>
            </dependency>
            <!-- jetbrain exposed: Kotlin ORM -->
            <dependency>
                <groupId>org.jetbrains.exposed</groupId>
                <artifactId>exposed-core</artifactId>
                <version>${jetbrains.exposed.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.exposed</groupId>
                <artifactId>exposed-dao</artifactId>
                <version>${jetbrains.exposed.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.exposed</groupId>
                <artifactId>exposed-jdbc</artifactId>
                <version>${jetbrains.exposed.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.exposed</groupId>
                <artifactId>exposed-java-time</artifactId>
                <version>${jetbrains.exposed.version}</version>
            </dependency>
            <!-- GraphQL -->
            <dependency>
                <groupId>com.expediagroup</groupId>
                <artifactId>graphql-kotlin-server</artifactId>
                <version>${graphql-kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>com.expediagroup</groupId>
                <artifactId>graphql-kotlin-schema-generator</artifactId>
                <version>${graphql-kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>com.graphql-java</groupId>
                <artifactId>graphql-java-extended-scalars</artifactId>
                <version>18.0</version>
            </dependency>

            <!-- command line parsing -->
            <dependency>
                <groupId>com.github.ajalt.clikt</groupId>
                <artifactId>clikt-jvm</artifactId>
                <version>3.2.0</version>
            </dependency>


            <!-- Protobuf/gRPC -->
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java-util</artifactId>
                <version>${protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-netty-shaded</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-protobuf</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-stub</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>1.2</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-testing</artifactId>
                <version>${grpc.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Utils -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>24.1-jre</version>
            </dependency>
            <dependency>
                <groupId>com.google.auto.value</groupId>
                <artifactId>auto-value-annotations</artifactId>
                <version>${autovalue.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.auto.value</groupId>
                <artifactId>auto-value</artifactId>
                <version>${autovalue.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-csv</artifactId>
                <version>1.9.0</version>
            </dependency>
            <dependency>
                <groupId>net.sf.saxon</groupId>
                <artifactId>Saxon-HE</artifactId>
                <version>9.7.0-18</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.5</version>
            </dependency>
            <dependency>
                <groupId>commons-cli</groupId>
                <artifactId>commons-cli</artifactId>
                <version>1.3.1</version>
            </dependency>
            <dependency>
                <groupId>commons-configuration</groupId>
                <artifactId>commons-configuration</artifactId>
                <version>1.10</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-collections4</artifactId>
                <version>4.2</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>1.6</version>
            </dependency>
            <dependency>
                <groupId>com.typesafe</groupId>
                <artifactId>config</artifactId>
                <version>1.3.0</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>2.6.1</version>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>3.2.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.jayway.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>1.7.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.codehaus.janino</groupId>
                <artifactId>janino</artifactId>
                <version>2.7.8</version>
            </dependency>
            <dependency>
                <groupId>me.tongfei</groupId>
                <artifactId>progressbar</artifactId>
                <version>0.5.5</version>
            </dependency>
            <dependency>
                <groupId>com.mashape.unirest</groupId>
                <artifactId>unirest-java</artifactId>
                <version>1.4.9</version>
            </dependency>
            <dependency>
                <groupId>com.google.errorprone</groupId>
                <artifactId>error_prone_annotations</artifactId>
                <version>2.1.3</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.mockk</groupId>
                <artifactId>mockk</artifactId>
                <version>1.10.6</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.10.10</version>
                <scope>test</scope>
            </dependency>

            <!-- DB -->
            <dependency>
                <groupId>org.xerial</groupId>
                <artifactId>sqlite-jdbc</artifactId>
                <version>3.36.0.3</version>
            </dependency>
            <!-- HikaryCP -->
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
                <version>5.0.1</version>
            </dependency>

            <!--Vert.x packages-->
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-core</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-web</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-jdbc-client</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-codegen</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-auth-oauth2</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-config</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-rx-java2</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-lang-kotlin</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-lang-kotlin-coroutines</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-auth-common</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-unit</artifactId>
                <version>${vertx.version}</version>
                <scope>test</scope>
            </dependency>

            <!--AWS packages-->
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-core</artifactId>
                <version>1.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-lambda-java-events</artifactId>
                <version>2.2.5</version>
            </dependency>

            <dependency>
                <groupId>com.ginsberg</groupId>
                <artifactId>junit5-system-exit</artifactId>
                <version>1.0.0</version>
                <scope>test</scope>
            </dependency>

            <!-- Auth0 -->
            <dependency>
                <groupId>com.auth0</groupId>
                <artifactId>java-jwt</artifactId>
                <version>3.18.2</version>
            </dependency>
            <dependency>
                <groupId>com.auth0</groupId>
                <artifactId>jwks-rsa</artifactId>
                <version>0.11.0</version>
            </dependency>

            <!-- XML -->
            <dependency>
                <groupId>dom4j</groupId>
                <artifactId>dom4j</artifactId>
                <version>1.6.1</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!--THINK CAREFULLY ABOUT PUTTING DEPENDENCIES HERE. DEFINE THEM IN DEPENDENCY MANAGEMENT AND LET THE INDIVIDUAL MODULE DECIDE IF IT NEEDS IT!-->
        <!--NO ZEPBEN PRODUCED LIBRARIES SHOULD BE INCLUDED HERE AS THEY SHOULD ALL BE REFERENCING THE SUPER POM AND THAT WILL CREATE CYCLIC REFERENCES!-->

        <!--Test Utils-->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.npathai</groupId>
            <artifactId>hamcrest-optional</artifactId>
            <version>2.0.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>

        <!--Add coverage to all projects-->
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
            <classifier>runtime</classifier>
            <version>${jacoco.version}</version>
            <scope>test</scope>
        </dependency>

        <!--THINK CAREFULLY ABOUT PUTTING DEPENDENCIES HERE. DEFINE THEM IN DEPENDENCY MANAGEMENT AND LET THE INDIVIDUAL MODULE DECIDE IF IT NEEDS IT!-->
        <!--NO ZEPBEN PRODUCED LIBRARIES SHOULD BE INCLUDED HERE AS THEY SHOULD ALL BE REFERENCING THE SUPER POM AND THAT WILL CREATE CYCLIC REFERENCES!-->
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.4.1.Final</version>
            </extension>
        </extensions>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.1.0</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <transformers>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                        <manifestEntries>
                                            <Main-Class>${mainClass}</Main-Class>
                                            <Specification-Title>${project.artifactId}</Specification-Title>
                                            <Specification-Version>${project.version}</Specification-Version>
                                            <Implementation-Title>${project.artifactId}</Implementation-Title>
                                            <Implementation-Version>${project.version}</Implementation-Version>
                                            <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                                        </manifestEntries>
                                    </transformer>
                                </transformers>
                                <artifactSet/>
                                <filters>
                                    <filter>
                                        <artifact>*:*</artifact>
                                        <excludes>
                                            <exclude>META-INF/*.SF</exclude>
                                            <exclude>META-INF/*.DSA</exclude>
                                            <exclude>META-INF/*.RSA</exclude>
                                        </excludes>
                                    </filter>
                                </filters>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Kotlin compilation -->
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>

                    <executions>
                        <execution>
                            <id>compile</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <sourceDirs>
                                    <source>src/main/java</source>
                                    <source>src/main/kotlin</source>
                                    <source>target/generated-sources/annotations</source>
                                    <source>target/generated-sources/java</source>
                                </sourceDirs>
                            </configuration>
                        </execution>
                        <execution>
                            <id>test-compile</id>
                            <phase>process-test-sources</phase>
                            <goals>
                                <goal>test-compile</goal>
                            </goals>
                            <configuration>
                                <sourceDirs>
                                    <source>src/test/java</source>
                                    <source>src/test/kotlin</source>
                                </sourceDirs>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <jvmTarget>${maven.compiler.release}</jvmTarget>
                        <languageVersion>${kotlin.language.version}</languageVersion>
                    </configuration>
                </plugin>

                <!-- Protobuf compilation -->
                <plugin>
                    <groupId>com.github.os72</groupId>
                    <artifactId>protoc-jar-maven-plugin</artifactId>
                    <version>${protobuf.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <protocVersion>${protobuf.version}</protocVersion>
                                <addSources>true</addSources>
                                <includeStdTypes>true</includeStdTypes>
                                <includeDirectories>
                                    <include>../proto</include>
                                </includeDirectories>
                                <inputDirectories>
                                    <include>proto</include>
                                    <include>../proto</include>
                                </inputDirectories>
                                <outputTargets>
                                    <outputTarget>
                                        <type>java</type>
                                        <outputDirectory>target/generated-sources/src</outputDirectory>
                                    </outputTarget>
                                    <outputTarget>
                                        <type>grpc-java</type>
                                        <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}</pluginArtifact>
                                        <outputDirectory>target/generated-sources/src</outputDirectory>
                                    </outputTarget>
                                </outputTargets>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <!--THINK CAREFULLY ABOUT PUTTING PLUGINS HERE. YOU WILL LIKELY WANT IT IN THE PLUGIN MANAGEMENT SECTION!-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>

                    <compilerArgs>
                        <!-- XXX: all Error Prone args should come in a single argument -->
                        <arg>-XDcompilePolicy=byfile</arg>
                        <arg>-Xlint:unchecked</arg>
                        <arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode</arg>
                    </compilerArgs>
                    <annotationProcessorPaths>
                        <annotationProcessorPath>
                            <groupId>com.google.errorprone</groupId>
                            <artifactId>error_prone_core</artifactId>
                            <version>2.3.4</version>
                        </annotationProcessorPath>
                        <annotationProcessorPath>
                            <groupId>com.google.auto.value</groupId>
                            <artifactId>auto-value</artifactId>
                            <version>${autovalue.version}</version>
                        </annotationProcessorPath>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>

            <!-- This plugin enforces that release version projects do not have any dependencies that are snapshots -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-no-snapshots</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireReleaseDeps>
                                    <onlyWhenRelease>true</onlyWhenRelease>
                                    <message>No Snapshots Allowed!</message>
                                </requireReleaseDeps>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Sources and javadocs -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <!--
                        Prepares the property pointing to the JaCoCo runtime agent which
                        is passed as VM argument when Maven the Surefire plugin is executed.
                    -->
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <destFile>${jacoco.ut.execution.data.file}</destFile>
                            <!--
                                Sets the name of the property containing the settings
                                for JaCoCo runtime agent.
                            -->
                            <propertyName>surefireArgLine</propertyName>
                        </configuration>
                    </execution>
                    <!--
                        Ensures that the code coverage report for unit tests is created after
                        unit tests have been run.
                    -->
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <dataFile>${jacoco.ut.execution.data.file}</dataFile>
                            <!-- Sets the output directory for the code coverage report. -->
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <dataFile>${jacoco.ut.execution.data.file}</dataFile>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit>
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco.coverage}</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                    <!--
                        Prepares the property pointing to the JaCoCo runtime agent which
                        is passed as VM argument when Maven the Failsafe plugin is executed.
                    -->
                    <execution>
                        <id>pre-integration-test</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <destFile>${jacoco.it.execution.data.file}</destFile>
                            <!--
                                Sets the name of the property containing the settings
                                for JaCoCo runtime agent.
                            -->
                            <propertyName>failsafeArgLine</propertyName>
                        </configuration>
                    </execution>
                    <!--
                        Ensures that the code coverage report for integration tests after
                        integration tests have been run.
                    -->
                    <execution>
                        <id>post-integration-test</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <dataFile>${jacoco.it.execution.data.file}</dataFile>
                            <!-- Sets the output directory for the code coverage report. -->
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Used for unit tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M3</version>
                <configuration>
                    <!-- Sets the VM argument line used when unit tests are run. -->
                    <argLine>${surefireArgLine} -Dfile.encoding=UTF-8</argLine>
                    <!-- Skips unit tests if the value of skip.unit.tests property is true -->
                    <skipTests>${skip.unit.tests}</skipTests>
                    <!-- Excludes integration tests when unit tests are run. -->
                    <excludes>
                        <exclude>**/IT*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <!-- Used for integration tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.22.0</version>
                <executions>
                    <!--
                        Ensures that both integration-test and verify goals of the Failsafe Maven
                        plugin are executed.
                    -->
                    <execution>
                        <id>integration-tests</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the VM argument line used when integration tests are run. -->
                            <argLine>${failsafeArgLine}</argLine>

                            <!--
                                Skips integration tests if the value of skip.integration.tests property
                                is true
                            -->
                            <skipTests>${skip.integration.tests}</skipTests>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <!-- Add "src/main/kotlin" as additional source directory, so that jacoco-maven-plugin
                        (or other plugins that care about sources) will look for files in it -->
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src/main/kotlin</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-test-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src/test/kotlin</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <!--THINK CAREFULLY ABOUT PUTTING PLUGINS HERE. YOU WILL LIKELY WANT IT IN THE PLUGIN MANAGEMENT SECTION!-->
        </plugins>

    </build>
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <!-- Sign artifacts with gpg. Requires gpg command to be available and creds configured in settings.xml
See: https://central.sonatype.org/pages/apache-maven.html#gpg-signed-components -->
                <plugins>
                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <version>${dokka.version}</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>javadocJar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <dokkaPlugins>
                                <plugin>
                                    <groupId>org.jetbrains.dokka</groupId>
                                    <artifactId>kotlin-as-java-plugin</artifactId>
                                    <version>${dokka.version}</version>
                                </plugin>
                            </dokkaPlugins>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Plugin for deploying to maven central -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
