<?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>io.zeebe</groupId>
  <artifactId>zeebe-worker-java-testutils</artifactId>
  <version>8.1.8</version>
  <packaging>jar</packaging>

  <name>Zeebe Worker Java Test Utilities</name>

  <scm>
    <url>https://github.com/camunda-community-hub/zeebe-worker-java-testutils</url>
    <connection>scm:git:git@github.com:camunda-community-hub/zeebe-worker-java-testutils.git
    </connection>
    <developerConnection>
      scm:git:git@github.com:camunda-community-hub/zeebe-worker-java-testutils.git
    </developerConnection>
    <tag>HEAD</tag>
  </scm>

  <prerequisites>
    <maven>${maven.version}</maven>
  </prerequisites>

  <parent>
    <artifactId>community-hub-release-parent</artifactId>
    <groupId>org.camunda.community</groupId>
    <relativePath />
    <version>1.4.2</version>
  </parent>

  <dependencies>
    <dependency>
      <artifactId>zeebe-client-java</artifactId>
      <groupId>io.camunda</groupId>
      <version>${zeebe.version}</version>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${version.assertj}</version>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <artifactId>awaitility</artifactId>
      <groupId>org.awaitility</groupId>
      <scope>test</scope>
      <version>${version.awaitility}</version>
    </dependency>
  </dependencies>

  <properties>
    <maven.version>3.0</maven.version>

    <plugin.version.fmt>2.13</plugin.version.fmt>

    <plugin.version.jacoco>0.8.8</plugin.version.jacoco>

    <plugin.version.javadoc>3.5.0</plugin.version.javadoc>
    <plugin.version.surefire>3.0.0-M9</plugin.version.surefire>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.assertj>3.24.2</version.assertj>

    <version.awaitility>4.2.0</version.awaitility>
    <version.java>11</version.java>
    <version.junit>5.9.2</version.junit>
    <zeebe.version>8.1.8</zeebe.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <artifactId>junit-bom</artifactId>
        <groupId>org.junit</groupId>
        <scope>import</scope>
        <type>pom</type>
        <version>${version.junit}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>


  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${plugin.version.javadoc}</version>
      </plugin>

      <!-- Google code format plugin -->
      <plugin>
        <groupId>com.coveo</groupId>
        <artifactId>fmt-maven-plugin</artifactId>
        <version>${plugin.version.fmt}</version>
        <executions>
          <execution>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- JaCoCo Plugin -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${plugin.version.jacoco}</version>
        <executions>
          <execution>
            <id>coverage-initialize</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>coverage-report</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <!-- Threshold -->
        </executions>
      </plugin>
      <!-- Surefire plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${plugin.version.surefire}</version>
      </plugin>

      <!-- flaky test extractor plugin -->
      <plugin>
        <groupId>io.zeebe</groupId>
        <artifactId>flaky-test-extractor-maven-plugin</artifactId>
        <version>2.1.1</version>
        <executions>
          <execution>
            <phase>post-integration-test</phase>
            <goals>
              <goal>extract-flaky-tests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>community-action-maven-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <!-- Prevent gpg from using pinentry programs -->
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
