<?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.devebot.opflow</groupId>
    <artifactId>opflow-prom-exporter</artifactId>
    <version>0.2.0</version>
    <packaging>jar</packaging>
    <name>opflow-prom-exporter</name>
    <description>Opflow Prometheus Exporter</description>
    <url>https://github.com/opflow/opflow-java-exporter</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Devebot Team</name>
            <email>contact@devebot.com</email>
            <organization>Devebot</organization>
            <organizationUrl>https://www.devebot.com</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/opflow/opflow-java-exporter.git</connection>
        <developerConnection>scm:git:ssh://github.com:opflow/opflow-java-exporter.git</developerConnection>
        <url>https://github.com/opflow/opflow-java-exporter/tree/master</url>
    </scm>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <artifact.name>${project.artifactId}</artifact.name>
        <java.version>1.8</java.version>
        <opflow.version>0.2.0</opflow.version>
        <prometheus.version>0.8.0</prometheus.version>
    </properties>

    <repositories>
        <repository>
            <id>repo1</id>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/staging</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>repo1</id>
            <url>http://repo1.maven.org/maven2</url>
        </pluginRepository>
        <pluginRepository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/staging</url>
        </pluginRepository>
    </pluginRepositories>
    
    <dependencies>
        <dependency>
            <groupId>com.devebot.opflow</groupId>
            <artifactId>opflow-core</artifactId>
            <version>${opflow.version}</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_hotspot</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
        <dependency>
            <groupId>io.prometheus</groupId>
            <artifactId>simpleclient_httpserver</artifactId>
            <version>${prometheus.version}</version>
        </dependency>
    </dependencies>
    
    <build>
        <finalName>${artifact.name}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <skipTests>false</skipTests>
                    <runOrder>alphabetical</runOrder>
                    <argLine>--add-opens java.xml/jdk.xml.internal=ALL-UNNAMED</argLine>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit4</artifactId>
                        <version>2.22.2</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dep</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>dep</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>2.7</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.1.1</version>
                        <configuration>
                            <source>8</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>git</id>
            <activation>
                <property>
                    <name>!profile.git.skip</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>pl.project13.maven</groupId>
                        <artifactId>git-commit-id-plugin</artifactId>
                        <version>4.0.0</version>
                        <executions>
                            <execution>
                                <id>get-the-git-infos</id>
                                <goals>
                                    <goal>revision</goal>
                                </goals>
                                <phase>initialize</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <dotGitDirectory>${dot.git.directory}</dotGitDirectory>
                            <prefix>git</prefix>
                            <verbose>false</verbose>
                            <dateFormat>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</dateFormat>
                            <generateGitPropertiesFile>true</generateGitPropertiesFile>
                            <generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/scm/com.devebot.opflow/opflow-prom-exporter/git-info.json</generateGitPropertiesFilename>
                            <includeOnlyProperties>
                                <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
                                <includeOnlyProperty>^git.commit.id$</includeOnlyProperty>
                                <includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
                            </includeOnlyProperties>
                            <excludeProperties>
                                <excludeProperty>^git.remote.origin.url$</excludeProperty>
                                <excludeProperty>^git.tags$</excludeProperty>
                            </excludeProperties>
                            <format>json</format>
                            <gitDescribe>
                                <skip>false</skip>
                                <always>false</always>
                                <dirty>-dirty</dirty>
                            </gitDescribe>
                        </configuration>
                    </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>
