<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.datadoghq</groupId>
    <artifactId>jmxfetch</artifactId>
    <version>0.36.2</version>
    <packaging>jar</packaging>

    <name>jmxfetch</name>
    <description>JMXFetch is the new tool to collect metrics from JMX Servers in order to be sent to Datadog
        (http://www.datadoghq.com) It is called by the Datadog Agent (https://github.com/Datadog/datadog-agent) and sends
        metrics back to the Agent using the Java dogstatsd library (https://github.com/datadog/java-dogstatsd-client).
    </description>
    <url>https://github.com/DataDog/jmxfetch</url>

    <licenses>
        <license>
            <name>BSD License</name>
            <url>https://github.com/DataDog/jmxfetch/blob/master/LICENSE</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Datadog</name>
            <email>info@datadoghq.com</email>
            <organization>Datadog</organization>
            <organizationUrl>https://www.datadoghq.com/</organizationUrl>
        </developer>
    </developers>

    <properties>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>

        <commons-io.version>2.4</commons-io.version>
        <commons-lang.version>2.6</commons-lang.version>
        <apache-commons-lang3.version>3.5</apache-commons-lang3.version>
        <guava.version>27.1-android</guava.version> <!-- From the docs: If you need support for JDK 1.7 or Android, use the Android flavor. -->
        <java-dogstatsd-client.version>2.9.0</java-dogstatsd-client.version>
        <jcommander.version>1.35</jcommander.version>
        <log4j.version>2.12.1</log4j.version>
        <slf4j.version>1.7.26</slf4j.version>
        <jackson.version>2.10.0</jackson.version>
        <snakeyaml.version>1.26</snakeyaml.version>
        <!-- Note: using project checkstyle with AOSP style
        find the default google java checkstyle config here -
		<checkstyle.config.location>google_checks.xml</checkstyle.config.location>
         -->
		<checkstyle.config.location>style.xml</checkstyle.config.location>

        <junit.version>4.11</junit.version>
        <mockito.version>2.2.27</mockito.version>

        <maven-surefire-plugin.version>2.9</maven-surefire-plugin.version>
        <buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <bintray.repo>datadog/datadog-maven</bintray.repo>
        <bintray.package>jmxfetch</bintray.package>
    </properties>

    <distributionManagement>
        <repository>
            <id>bintray-jmxfetch</id>
            <url>https://api.bintray.com/maven/${bintray.repo}/${bintray.package}/;publish=1</url>
        </repository>
    </distributionManagement>
    <dependencies>
        <dependency>
            <groupId>com.beust</groupId>
            <artifactId>jcommander</artifactId>
            <version>${jcommander.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun</groupId>
            <artifactId>tools</artifactId>
            <version>1.4.2</version>
            <scope>system</scope>
            <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>${commons-lang.version}</version>
        </dependency>
        <dependency>
            <groupId>com.datadoghq</groupId>
            <artifactId>java-dogstatsd-client</artifactId>
            <version>${java-dogstatsd-client.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <!-- Note: core-annotations version x.y.0 is generally compatible with
                 (identical to) version x.y.1, x.y.2, etc. -->
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.8</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${snakeyaml.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.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <scm>
        <connection>scm:git:git@github.com:Datadog/jmxfetch.git</connection>
        <developerConnection>scm:git:git@github.com:Datadog/jmxfetch.git
        </developerConnection>
        <url>git@github.com:Datadog/jmxfetch.git</url>
    </scm>
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>${buildnumber-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <revisionOnScmFailure>N/A</revisionOnScmFailure>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                    <attach>true</attach>
                    <!--make it available for jar/war classpath resource -->
                    <addOutputDirectoryToResources>true</addOutputDirectoryToResources>
                </configuration>
            </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>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven-assembly-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>org.datadog.jmxfetch.App</mainClass>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Branch>${scmBranch}</Implementation-Branch>
                            <Implementation-Build>${buildNumber}</Implementation-Build>
                        </manifestEntries>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <phase>verify</phase>
                        <configuration>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <failOnViolation>true</failOnViolation>
                            <violationSeverity>warning</violationSeverity>
                            <linkXRef>false</linkXRef>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.0.0</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
</project>
