<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>
  <name>Zeebe Map</name>
  <artifactId>zb-map</artifactId>
  <packaging>jar</packaging>

  <parent>
    <groupId>io.zeebe</groupId>
    <artifactId>zb-util-root</artifactId>
    <version>0.2.0</version>
    <relativePath>../</relativePath>
  </parent>

  <properties>
    <uberjar.name>${project.artifactId}-benchmarks</uberjar.name>
  </properties>

  <dependencies>
  	 <dependency>
      <groupId>io.zeebe</groupId>
      <artifactId>zb-util</artifactId>
    </dependency>

    <dependency>
      <groupId>org.agrona</groupId>
      <artifactId>agrona</artifactId>
    </dependency>

    <dependency>
      <groupId>io.zeebe</groupId>
      <artifactId>zb-test-util</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
    </dependency>

  </dependencies>

  <profiles>
    <profile>
      <id>benchmarks</id>
      <dependencies>
        <!-- JMH -->
        <dependency>
          <groupId>org.openjdk.jmh</groupId>
          <artifactId>jmh-core</artifactId>
        </dependency>
        <dependency>
          <groupId>org.openjdk.jmh</groupId>
          <artifactId>jmh-generator-annprocess</artifactId>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.agrona</groupId>
          <artifactId>agrona</artifactId>
          <scope>compile</scope>
        </dependency>

        <dependency>
          <groupId>net.openhft</groupId>
          <artifactId>chronicle-map</artifactId>
          <version>3.13.0</version>
        </dependency>

        <dependency>
          <groupId>it.unimi.dsi</groupId>
          <artifactId>dsiutils</artifactId>
          <version>2.4.0</version>
        </dependency>
      </dependencies>

      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-source</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>add-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/benchmarks/java</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <finalName>${uberjar.name}</finalName>
                  <transformers>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                      <mainClass>org.openjdk.jmh.Main</mainClass>
                    </transformer>
                  </transformers>
                  <filters>
                    <filter>
                      <!-- Shading signed JARs will fail without this. http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar -->
                      <artifact>*:*</artifact>
                      <excludes>
                        <exclude>META-INF/*.SF</exclude>
                        <exclude>META-INF/*.DSA</exclude>
                        <exclude>META-INF/*.RSA</exclude>
                      </excludes>
                    </filter>
                  </filters>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

    </profile>
  </profiles>
</project>

