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

    <parent>
        <groupId>com.spotify</groupId>
        <artifactId>apollo-parent</artifactId>
        <version>1.6.3</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <name>Spotify Apollo Metrics Module</name>
    <artifactId>apollo-metrics</artifactId>
    <packaging>jar</packaging>

    <properties>
        <semantic-metrics.version>0.11.2</semantic-metrics.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.spotify</groupId>
                <artifactId>apollo-bom</artifactId>
                <version>1.6.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.spotify</groupId>
            <artifactId>apollo-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.spotify</groupId>
            <artifactId>apollo-environment</artifactId>
        </dependency>
        <dependency>
            <groupId>com.spotify.metrics</groupId>
            <artifactId>semantic-metrics-core</artifactId>
            <version>${semantic-metrics.version}</version>
        </dependency>
        <dependency>
            <groupId>com.spotify.metrics</groupId>
            <artifactId>semantic-metrics-ffwd-reporter</artifactId>
            <version>${semantic-metrics.version}</version>
        </dependency>
        <dependency>
            <groupId>com.spotify.metrics</groupId>
            <artifactId>semantic-metrics-ffwd-http-reporter</artifactId>
            <version>${semantic-metrics.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.auto.service</groupId>
            <artifactId>auto-service</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.auto.value</groupId>
            <artifactId>auto-value</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <rule>
                                            <element>BUNDLE</element>
                                            <limits>
                                                <limit>
                                                    <counter>INSTRUCTION</counter>
                                                    <value>COVEREDRATIO</value>
                                                    <minimum>0.65</minimum>
                                                </limit>
                                            </limits>
                                        </rule>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
