<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 Groupon.com
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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">
  <parent>
    <groupId>com.arpnetworking.build</groupId>
    <artifactId>arpnetworking-parent-pom</artifactId>
    <version>3.3.2</version>
    <relativePath />
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.arpnetworking.test</groupId>
  <artifactId>performance-test</artifactId>
  <packaging>jar</packaging>
  <name>Performance Test</name>
  <description>Extensions to JUnit and JUnitBenchmarks to execute performance tests with cpu profiling</description>
  <version>1.2.2</version>

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

  <developers>
    <developer>
      <id>brandonarp</id>
      <email>brandon.arp@inscopemetrics.com</email>
      <organization>Inscope Metrics</organization>
      <organizationUrl>http://www.inscopemetrics.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>villekoskela</id>
      <email>ville.koskela@inscopemetrics.com</email>
      <organization>Inscope Metrics</organization>
      <organizationUrl>http://www.inscopemetrics.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:arpnetworking/performance-test.git</connection>
    <developerConnection>scm:git:git@github.com:arpnetworking/performance-test.git</developerConnection>
    <url>https://github.com/arpnetworking/performance-test</url>
    <tag>performance-test-1.2.2</tag>
  </scm>

  <properties>
    <!--Dependency versions-->
    <ant.version>1.10.14</ant.version>
    <arpnetworking.commons.version>3.1.1</arpnetworking.commons.version>
    <cglib.version>3.3.0</cglib.version>
    <commons.compress.version>1.26.1</commons.compress.version>
    <docker.client.version>8.16.0</docker.client.version>
    <spotbugs.annotations.version>4.8.3</spotbugs.annotations.version>
    <guava.version>33.1.0-jre</guava.version>
    <jackson.version>2.17.0</jackson.version>
    <hamcrest.version>2.2</hamcrest.version>
    <jsr305.version>3.0.2</jsr305.version>
    <junit.version>4.13.2</junit.version>
    <junit.benchmarks.version>0.7.2</junit.benchmarks.version>
    <logback.version>1.5.3</logback.version>
    <mockito.version>5.11.0</mockito.version>
    <slf4j.version>2.0.12</slf4j.version>

    <!-- Findbugs -->
    <spotbugs.exclude>${project.basedir}/findbugs.exclude.xml</spotbugs.exclude>

    <!-- Code Coverage -->
    <jacoco.check.line.coverage>0.75</jacoco.check.line.coverage>
    <jacoco.check.branch.coverage>0.80</jacoco.check.branch.coverage>
  </properties>

  <build>
    <plugins>
      <!-- Enable Inherited Plugins -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.rimerosolutions.maven.plugins</groupId>
        <artifactId>wrapper-maven-plugin</artifactId>
        <inherited>false</inherited>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <!-- Google -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    <!-- Jackson -->
    <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-databind</artifactId>
      <version>${jackson.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jdk8</artifactId>
      <version>${jackson.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- General -->
    <dependency>
      <groupId>com.spotify</groupId>
      <artifactId>docker-client</artifactId>
      <classifier>shaded</classifier>
      <version>${docker.client.version}</version>
      <exclusions>
        <!-- TODO(ville): Docker client has an old version of SLF4J
            https://github.com/spotify/docker-client/pull/1130
        -->
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
        <!-- TODO(ville): Docker client does not shade correctly
            https://github.com/spotify/docker-client/issues/1012
        -->
        <exclusion>
          <groupId>com.fasterxml.jackson.jaxrs</groupId>
          <artifactId>jackson-jaxrs-json-provider</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.fasterxml.jackson.datatype</groupId>
          <artifactId>jackson-datatype-guava</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.glassfish.jersey.core</groupId>
          <artifactId>jersey-client</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.glassfish.jersey.connectors</groupId>
          <artifactId>jersey-apache-connector</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.glassfish.jersey.media</groupId>
          <artifactId>jersey-media-json-jackson</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.github.jnr</groupId>
          <artifactId>jnr-unixsocket</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpcore</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
      <version>${commons.compress.version}</version>
    </dependency>
    <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib</artifactId>
      <version>${cglib.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.arpnetworking.commons</groupId>
      <artifactId>commons</artifactId>
      <version>${arpnetworking.commons.version}</version>
    </dependency>
    <dependency>
      <groupId>com.carrotsearch</groupId>
      <artifactId>junit-benchmarks</artifactId>
      <version>${junit.benchmarks.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>${jsr305.version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-annotations</artifactId>
      <version>${spotbugs.annotations.version}</version>
      <scope>provided</scope>
    </dependency>
    <!-- Test - General -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
      <exclusions>
        <!-- TODO(ville): Remove once JUnit depends on modern hamcrest; see:
            http://hamcrest.org/JavaHamcrest/distributables
        -->
        <exclusion>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>${ant.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback.version}</version>
        <scope>test</scope>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>unitPerformanceTest</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>default-test</id>
                <configuration>
                  <includes>
                    <include>**/*TestPerf.java</include>
                  </includes>
                  <parallel combine.self="override" />
                  <forkCount>1</forkCount>
                  <reuseForks>false</reuseForks>
                  <argLine combine.self="override">${argLine} -Xms512m -ea -Duser.timezone="UTC" -agentlib:hprof=cpu=samples,depth=20,interval=1,force=y,verbose=y,doe=n,file=${basedir}/target/perf.unit.hprof.txt</argLine>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
