<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 Logstreams</name>
  <artifactId>zb-logstreams</artifactId>
  <version>0.9.0</version>
  <packaging>jar</packaging>

  <parent>
    <groupId>io.zeebe</groupId>
    <artifactId>zb-parent</artifactId>
    <version>0.6.0</version>
    <!-- do not remove empty tag - http://jira.codehaus.org/browse/MNG-4687 -->
    <relativePath />
  </parent>

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

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.zeebe</groupId>
        <artifactId>zb-bom</artifactId>
        <version>${project.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.zeebe</groupId>
      <artifactId>zb-dispatcher</artifactId>
    </dependency>
    
    <dependency>
      <groupId>io.zeebe</groupId>
      <artifactId>zb-service-container</artifactId>
    </dependency>

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

    <dependency>
      <groupId>io.zeebe</groupId>
      <artifactId>zb-map</artifactId>
    </dependency>

    <dependency>
      <groupId>io.zeebe</groupId>
      <artifactId>zb-msgpack-value</artifactId>
    </dependency>

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

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

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

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

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

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

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

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

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

    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>


  <profiles>
    <profile>
      <id>jmh</id>

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

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>package-jmh-jar</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <attach>true</attach>
                  <archive>
                    <manifest>
                      <mainClass>org.openjdk.jmh.Main</mainClass>
                    </manifest>
                  </archive>
                  <descriptor>src/test/jmh/assembly.xml</descriptor>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>run-jmh-test</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <classpathScope>test</classpathScope>
                  <executable>java</executable>
                  <arguments>
                    <argument>-classpath</argument>
                    <classpath />
                    <argument>org.openjdk.jmh.Main</argument>
                    <argument>.*</argument>
                    <argument>-rf</argument>
                    <argument>json</argument>
                    <argument>-rff</argument>
                    <argument>target/jmh-result.json</argument>
                    <argument>-r</argument>
                    <argument>30</argument>
                    <argument>-i</argument>
                    <argument>5</argument>
                    <argument>-wi</argument>
                    <argument>5</argument>
                    <argument>-f</argument>
                    <argument>1</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <repositories>
    <repository>
      <id>zeebe</id>
      <name>Zeebe Repository</name>
      <url>https://app.camunda.com/nexus/content/repositories/zeebe-io/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>

    <repository>
      <id>zeebe-snapshots</id>
      <name>Zeebe Snapshot Repository</name>
      <url>https://app.camunda.com/nexus/content/repositories/zeebe-io-snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <scm>
    <url>https://github.com/zeebe-io/zb-logstreams</url>
    <connection>scm:git:git@github.com:zeebe-io/zb-logstreams.git</connection>
    <developerConnection>scm:git:git@github.com:zeebe-io/zb-logstreams.git</developerConnection>
    <tag>0.9.0</tag>
  </scm>

</project>
