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

    <groupId>com.ringcentral.platform.metrics</groupId>
    <artifactId>metrics-facade</artifactId>
    <version>3.2.0-RELEASE</version>

    <name>RingCentral Metrics Facade</name>
    <url>https://github.com/ringcentral/metrics-facade</url>

    <description>
        RingCentral Metrics Facade is a Java library for working with metrics,
        allowing extremely flexible configuration of metrics and their export,
        designed to be generic and not tied to a specific implementation.
    </description>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/ringcentral/metrics-facade</url>
        <connection>scm:git:git@github.com:ringcentral/metrics-facade.git</connection>
        <developerConnection>scm:git:ssh://github.com:ringcentral/metrics-facade.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <id>devromik</id>
            <name>Roman Shulnyaev</name>
            <url>https://github.com/devromik</url>
        </developer>

        <developer>
            <id>ikurovsky</id>
            <name>Igor Kurovsky</name>
            <url>https://github.com/ikurovsky</url>
        </developer>

        <developer>
            <id>derbylock</id>
            <name>Anton Tolokan</name>
            <url>https://github.com/derbylock</url>
        </developer>

        <developer>
            <id>gleb4646</id>
            <name>Gleb Smirnov</name>
            <url>https://github.com/gleb4646</url>
        </developer>

        <developer>
            <id>mairovichaa</id>
            <name>Andrei Mairovich</name>
            <url>https://github.com/mairovichaa</url>
        </developer>

        <developer>
            <id>kkolyan</id>
            <name>Nikolay Plekhanov</name>
            <url>https://github.com/kkolyan</url>
        </developer>
    </developers>

    <modules>
        <module>metrics-facade-base</module>
        <module>metrics-facade-dropwizard</module>
        <module>metrics-facade-default-impl</module>
        <module>metrics-facade-prometheus</module>
        <module>metrics-facade-samples</module>
        <module>metrics-facade-test-support</module>
        <module>metrics-facade-shared-tests</module>
        <module>metrics-facade-spring</module>
        <module>metrics-facade-benchmark</module>
        <module>metrics-facade-dropwizard-to-prometheus</module>
    </modules>

    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <prometheus.version>0.15.0</prometheus.version>
        <dropwizard-metrics.version>4.1.17</dropwizard-metrics.version>

        <reflections.version>0.10.2</reflections.version>
        <commons-lang3.version>3.11</commons-lang3.version>
        <jackson.version>2.13.3</jackson.version>
        <slf4j-api.version>1.7.30</slf4j-api.version>
        <logback-classic.version>1.2.3</logback-classic.version>
        <junit.version>4.13.1</junit.version>
        <mockito-core.version>3.11.2</mockito-core.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.reflections</groupId>
                <artifactId>reflections</artifactId>
                <version>${reflections.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j-api.version}</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</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>${maven-javadoc-plugin.version}</version>

                <executions>
                    <execution>
                        <id>attach-javadocs</id>

                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deploy-to-maven-central</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>

                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>

                                <goals>
                                    <goal>sign</goal>
                                </goals>

                                <configuration>
                                    <!--
                                      Prevent gpg from using pinentry programs.
                                      Fixes: gpg: signing failed: Inappropriate ioctl for device
                                    -->
                                    <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>