<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.expediagroup</groupId>
    <artifactId>dropwizard-prometheus-bundle</artifactId>
    <version>0.0.2</version>
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>

    <description>Dropwizard bundle to integrate dropwizard metrics with prometheus</description>
    <url>https://github.com/eleduardo/dropwizard-prometheus-bundle</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/homeaway/dropwizard-prometheus-bundle</url>
        <connection>scm:git:ssh://git@github.com/homeaway/dropwizard-prometheus-bundle.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/homeaway/dropwizard-prometheus-bundle.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <name>Eduardo Solis</name>
            <email>edusolis@homeaway.com</email>
            <organization>HomeAway</organization>
            <organizationUrl>https://www.homeaway.com</organizationUrl>
        </developer>
    </developers>

    <properties>

        <!--Java-->
        <java.source.version>1.8</java.source.version>
        <java.target.version>1.8</java.target.version>

        <!--Encoding-->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- JaCoCo Coverage -->
        <coverage.line>0.80</coverage.line>

        <dropwizard.version>1.3.8</dropwizard.version>
        <prometheus.version>0.6.0</prometheus.version>

        <!-- Testing -->
        <junit.jupiter.version>5.4.0</junit.jupiter.version>
        <assert4j.version>3.11.1</assert4j.version>

        <!-- Utilities -->
        <lombok.version>1.18.4</lombok.version>

        <!-- Plugins -->
        <source.pluginVersion>3.0.1</source.pluginVersion>
        <surefire.pluginVersion>2.22.1</surefire.pluginVersion>
        <compiler.pluginVersion>3.8.0</compiler.pluginVersion>
        <release.pluginVersion>2.5.3</release.pluginVersion>
        <preparationGoals>clean install</preparationGoals>

        <!-- OSSRH -->
        <nexusStaging.pluginVersion>1.6.8</nexusStaging.pluginVersion>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.dropwizard</groupId>
                <artifactId>dropwizard-bom</artifactId>
                <version>${dropwizard.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-core</artifactId>
        </dependency>

        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
        </dependency>

        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_dropwizard</artifactId>
            <version>${prometheus.version}</version>
        </dependency>

        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_servlet</artifactId>
            <version>${prometheus.version}</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-testing</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assert4j.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.pluginVersion}</version>
                <configuration>
                    <fork>true</fork>
                    <compilerArguments>
                        <parameters />
                    </compilerArguments>
                    <source>${java.source.version}</source>
                    <target>${java.target.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${source.pluginVersion}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.pluginVersion}</version>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>${release.pluginVersion}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>signed</releaseProfiles>
                    <!-- to ensure we only deploy during release:perform -->
                    <goals>deploy</goals>
                    <!-- to ensure that tags are of the right format -->
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- We create a profile here for two things: -->
            <!-- 1. centrally specify the deploy to ossrh -->
            <!-- 2. Sign all relevant artifacts (via configured GPG keys) -->
            <!-- TODO: Automate Release Process #106 -->
            <id>signed</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexusStaging.pluginVersion}</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-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
