<?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.dropwizard</groupId>
    <artifactId>dropwizard-prometheus-bundle</artifactId>
    <version>2.1.1</version>
    <packaging>jar</packaging>

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

    <description>Dropwizard bundle to integrate dropwizard metrics with prometheus</description>
    <url>https://github.com/ExpediaGroup/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/ExpediaGroup/dropwizard-prometheus-bundle</url>
        <connection>scm:git:ssh://git@github.com/ExpediaGroup/dropwizard-prometheus-bundle.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/ExpediaGroup/dropwizard-prometheus-bundle.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <name>Expedia Group Committers</name>
            <email>oss@expediagroup.com</email>
            <organization>Expedia Group</organization>
            <organizationUrl>https://www.expediagroup.com/</organizationUrl>
        </developer>
    </developers>

    <properties>

        <!--Java-->
        <java.source.version>11</java.source.version>
        <java.target.version>11</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>2.0.28</dropwizard.version>
        <metrics4.version>4.1.29</metrics4.version>
        <prometheus.version>0.15.0</prometheus.version>

        <!-- Testing -->
        <junit.jupiter.version>5.8.2</junit.jupiter.version>
        <assert4j.version>3.21.0</assert4j.version>

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

        <!-- Plugins -->
        <compiler.pluginVersion>3.9.0</compiler.pluginVersion>
        <enforcer.pluginVersion>3.0.0</enforcer.pluginVersion>
        <javadoc.pluginVersion>3.3.2</javadoc.pluginVersion>
        <release.pluginVersion>3.0.0-M5</release.pluginVersion>
        <source.pluginVersion>3.2.1</source.pluginVersion>
        <surefire.pluginVersion>3.0.0-M5</surefire.pluginVersion>
        <preparationGoals>clean install</preparationGoals>

        <!-- OSSRH -->
        <nexusStaging.pluginVersion>1.6.12</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>

            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-bom</artifactId>
                <version>${metrics4.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-enforcer-plugin</artifactId>
                <version>${enforcer.pluginVersion}</version>
                <executions>
                    <execution>
                        <id>enforce-jakarta-apis</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <!-- Replaced with jakarta.activation:jakarta.activation-api -->
                                        <exclude>javax.activation:javax.activation-api</exclude>
                                        <!-- Replaced with jakarta.annotation:jakarta.annotation-api -->
                                        <exclude>javax.annotation:javax.annotation-api</exclude>
                                        <!-- Replaced with jakarta.inject:jakarta.inject-api or org.glassfish.hk2.external:jakarta.inject -->
                                        <exclude>javax.inject:javax.inject</exclude>
                                        <!-- Replaced with jakarta.servlet:jakarta.servlet-api -->
                                        <exclude>javax.servlet:javax.servlet-api</exclude>
                                        <!-- Replaced with jakarta.validation:jakarta.validation-api -->
                                        <exclude>javax.validation:validation-api</exclude>
                                        <!-- Replaced with jakarta.xml.bind:jakarta.xml.bind-api -->
                                        <exclude>javax.xml.bind:jaxb-api</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </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>${javadoc.pluginVersion}</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>
            <id>release</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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </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>
