<?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>

  <parent>
    <groupId>org.camunda.community</groupId>
    <artifactId>community-hub-release-parent</artifactId>
    <version>1.2.2</version>
    <!-- do not remove empty tag - http://jira.codehaus.org/browse/MNG-4687 -->
    <relativePath/>
  </parent>

  <groupId>io.zeebe</groupId>
  <artifactId>zeebe-test-container-root</artifactId>
  <version>3.5.2</version>
  <packaging>pom</packaging>
  <name>Zeebe Test Container Root</name>
  <url>https://github.com/zeebe-io/zeebe-test-container</url>
  <inceptionYear>2019</inceptionYear>

  <modules>
    <module>core</module>
    <module>engine</module>
    <module>exporter</module>
    <module>exporter-test</module>
  </modules>

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

  <properties>
    <!-- release parent settings -->
    <version.java>17</version.java>
    <nexus.snapshot.repository>https://artifacts.camunda.com/artifactory/zeebe-io-snapshots/</nexus.snapshot.repository>
    <nexus.release.repository>https://artifacts.camunda.com/artifactory/zeebe-io/</nexus.release.repository>

    <!-- disable jdk8 javadoc checks on release build -->
    <additionalparam>-Xdoclint:none</additionalparam>

    <!--
      you can use the following to disable specific checks. the approach taken is to use a single
      new property, skipChecks, which is the default value for pre-defined properties such as
      checkstyle.skip. that way, you can use skipChecks, but you can also still use checkstyle.skip
      if you only want to disable checkstyle
      -->
    <skipChecks>false</skipChecks>
    <checkstyle.skip>${skipChecks}</checkstyle.skip>
    <dependency-check.skip>${skipChecks}</dependency-check.skip>
    <enforcer.skip>${skipChecks}</enforcer.skip>
    <mdep.analyze.skip>${skipChecks}</mdep.analyze.skip>
    <revapi.skip>${skipChecks}</revapi.skip>
    <spotless.check.skip>${skipChecks}</spotless.check.skip>

    <!-- project dependencies -->
    <version.agrona>1.17.1</version.agrona>
    <version.apiguardian>1.1.2</version.apiguardian>
    <version.asm>9.3</version.asm>
    <version.assertj>3.23.1</version.assertj>
    <version.awaitility>4.2.0</version.awaitility>
    <version.checkstyle>9.3</version.checkstyle>
    <version.compress>1.21</version.compress>
    <version.docker>3.2.13</version.docker>
    <version.duct-tape>1.0.8</version.duct-tape>
    <version.feign>11.10</version.feign>
    <version.httpcore5>5.1.4</version.httpcore5>
    <version.jackson>2.13.4</version.jackson>
    <version.jcip>1.0</version.jcip>
    <version.junit-jupiter>5.9.1</version.junit-jupiter>
    <version.junit-surefire-provider>1.3.2</version.junit-surefire-provider>
    <version.mockito>4.8.0</version.mockito>
    <version.rest-assured>5.2.0</version.rest-assured>
    <version.revapi>0.27.0</version.revapi>
    <version.slf4j>1.7.36</version.slf4j>
    <version.testcontainers>1.17.3</version.testcontainers>
    <version.wiremock>2.34.0</version.wiremock>
    <version.zeebe>8.0.6</version.zeebe>

    <!-- plugin version -->
    <plugin.version.checkstyle>3.2.0</plugin.version.checkstyle>
    <plugin.version.clean>3.2.0</plugin.version.clean>
    <plugin.version.dependency>3.3.0</plugin.version.dependency>
    <plugin.version.enforcer>3.1.0</plugin.version.enforcer>
    <plugin.version.flatten>1.3.0</plugin.version.flatten>
    <plugin.version.google-format>1.15.0</plugin.version.google-format>
    <plugin.version.gpg>3.0.1</plugin.version.gpg>
    <plugin.version.jar>3.3.0</plugin.version.jar>
    <plugin.version.javadoc>3.4.1</plugin.version.javadoc>
    <plugin.version.resources>3.3.0</plugin.version.resources>
    <plugin.version.revapi>0.14.7</plugin.version.revapi>
    <plugin.version.shade>3.4.0</plugin.version.shade>
    <plugin.version.spotless>2.27.0</plugin.version.spotless>
    <plugin.version.surefire>3.0.0-M7</plugin.version.surefire>

    <!-- maven extensions -->
    <extension.version.os-maven-plugin>1.6.1</extension.version.os-maven-plugin>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Sibling modules -->
      <dependency>
        <groupId>io.zeebe</groupId>
        <artifactId>zeebe-test-container</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>io.zeebe</groupId>
        <artifactId>zeebe-test-container-exporter</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>io.zeebe</groupId>
        <artifactId>zeebe-test-container-exporter-test</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>io.zeebe</groupId>
        <artifactId>zeebe-test-container-engine</artifactId>
        <version>${project.version}</version>
      </dependency>

      <!-- Zeebe dependencies -->
      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>zeebe-bom</artifactId>
        <version>${version.zeebe}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>zeebe-protocol-jackson</artifactId>
        <version>${version.zeebe}</version>
      </dependency>

      <!-- Zeebe Process Test dependencies -->
      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>zeebe-process-test-api</artifactId>
        <version>${version.zeebe}</version>
      </dependency>

      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>zeebe-process-test-assertions</artifactId>
        <version>${version.zeebe}</version>
      </dependency>

      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>zeebe-process-test-filters</artifactId>
        <version>${version.zeebe}</version>
      </dependency>

      <!-- Testing engine -->
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${version.junit-jupiter}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- Core Testcontainers dependencies -->
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${version.testcontainers}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>com.github.docker-java</groupId>
        <artifactId>docker-java-api</artifactId>
        <version>${version.docker}</version>
      </dependency>

      <dependency>
        <groupId>org.rnorth.duct-tape</groupId>
        <artifactId>duct-tape</artifactId>
        <version>${version.duct-tape}</version>
      </dependency>

      <!-- Easy HTTP clients, primarily for actuators -->
      <dependency>
        <groupId>io.github.openfeign</groupId>
        <artifactId>feign-bom</artifactId>
        <version>${version.feign}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- General (de)serialization -->
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${version.jackson}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- REST API testing, primarily for the exporter/receiver -->
      <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>rest-assured-bom</artifactId>
        <version>${version.rest-assured}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- API compatibility guarantee annotations -->
      <dependency>
        <groupId>org.apiguardian</groupId>
        <artifactId>apiguardian-api</artifactId>
        <version>${version.apiguardian}</version>
      </dependency>

      <!-- Thin HTTP/1.1 server components -->
      <dependency>
        <groupId>org.apache.httpcomponents.core5</groupId>
        <artifactId>httpcore5</artifactId>
        <version>${version.httpcore5}</version>
      </dependency>

      <!-- various utilities -->
      <dependency>
        <groupId>org.agrona</groupId>
        <artifactId>agrona</artifactId>
        <version>${version.agrona}</version>
      </dependency>

      <!-- for TAR archives -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${version.compress}</version>
      </dependency>

      <!-- mocking -->
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${version.mockito}</version>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${version.mockito}</version>
      </dependency>

      <!-- logging -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${version.slf4j}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${version.slf4j}</version>
      </dependency>

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

      <!-- asynchronous assertions -->
      <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <version>${version.awaitility}</version>
      </dependency>

      <!-- HTTP mock server, primarily used to test the debug exporter/receiver -->
      <dependency>
        <groupId>com.github.tomakehurst</groupId>
        <artifactId>wiremock-jre8</artifactId>
        <version>${version.wiremock}</version>
        <exclusions>
          <!-- fixes dependency convergence between this and testcontainers -> junit4 -->
          <exclusion>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>net.jcip</groupId>
        <artifactId>jcip-annotations</artifactId>
        <version>${version.jcip}</version>
        <scope>provided</scope>
      </dependency>

      <!-- dependencies entirely for convergence; versions can be hardcoded here -->
      <dependency>
        <groupId>com.google.errorprone</groupId>
        <artifactId>error_prone_annotations</artifactId>
        <version>2.15.0</version>
      </dependency>

      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>6.0.0</version>
      </dependency>

      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.15</version>
      </dependency>

      <dependency>
        <groupId>org.jetbrains</groupId>
        <artifactId>annotations</artifactId>
        <version>23.0.0</version>
      </dependency>

      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest</artifactId>
        <version>2.2</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

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

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

  <build>
    <pluginManagement>
      <plugins>
        <!-- compiler plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${plugin.version.compiler}</version>
          <configuration combine.children="append">
            <!-- setting it to true unfortunately causes us to recompile every time -->
            <useIncrementalCompilation>false</useIncrementalCompilation>
          </configuration>
        </plugin>

        <!-- JAR packaging plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${plugin.version.jar}</version>
          <configuration>
            <useDefaultManifestFile>false</useDefaultManifestFile>
          </configuration>
        </plugin>

        <!-- fix javadoc plugin version to 3.1.0 to fix module error -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${plugin.version.javadoc}</version>
          <configuration>
            <source>${version.java}</source>
          </configuration>
        </plugin>

        <!-- Licensing and formatting -->
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${plugin.version.spotless}</version>
          <configuration>
            <java>
              <googleJavaFormat>
                <version>${plugin.version.google-format}</version>
                <style>GOOGLE</style>
              </googleJavaFormat>
              <licenseHeader>
                <file>${maven.multiModuleProjectDirectory}/HEADER</file>
              </licenseHeader>
            </java>
            <pom>
              <includes>
                <include>pom.xml</include>
              </includes>
              <sortPom>
                <expandEmptyElements>false</expandEmptyElements>
              </sortPom>
            </pom>
            <markdown>
              <includes>
                <include>**/*.md</include>
              </includes>

              <flexmark/>
            </markdown>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>validate</phase>
            </execution>
          </executions>
        </plugin>

        <!-- Linting -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${plugin.version.checkstyle}</version>
          <configuration>
            <configLocation>check/.checkstyle.xml</configLocation>
            <includeTestSourceDirectory>true</includeTestSourceDirectory>
            <encoding>UTF-8</encoding>
            <failOnViolation>true</failOnViolation>
            <sourceDirectories>
              <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
              <sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
            </sourceDirectories>
          </configuration>
          <!-- dependency on build tool to reference the checkstyle cfg -->
          <dependencies>
            <dependency>
              <groupId>io.camunda</groupId>
              <artifactId>zeebe-build-tools</artifactId>
              <version>${version.zeebe}</version>
            </dependency>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${version.checkstyle}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>validate-java</id>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>validate</phase>
              <configuration/>
            </execution>
          </executions>
        </plugin>

        <!-- unit tests -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${plugin.version.surefire}</version>
          <configuration>
            <failIfNoTests>false</failIfNoTests>
            <trimStackTrace>false</trimStackTrace>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.junit.jupiter</groupId>
              <artifactId>junit-jupiter-engine</artifactId>
              <version>${version.junit-jupiter}</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${plugin.version.clean}</version>
        </plugin>

        <!-- Uber JAR building -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${plugin.version.shade}</version>
        </plugin>

        <!-- Resources Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${plugin.version.resources}</version>
        </plugin>

        <!-- dependency analysis -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${plugin.version.dependency}</version>
          <executions>
            <execution>
              <id>analyze-dependencies</id>
              <goals>
                <goal>analyze-only</goal>
              </goals>
              <phase>verify</phase>
              <configuration>
                <failOnWarning>true</failOnWarning>
                <outputXML>true</outputXML>
                <!-- dependencies not directly used in all projects during tests -->
                <ignoredUnusedDeclaredDependencies combine.children="append">
                  <dep>org.slf4j:slf4j-simple</dep>
                </ignoredUnusedDeclaredDependencies>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- compatibility checks/guard -->
        <plugin>
          <groupId>org.revapi</groupId>
          <artifactId>revapi-maven-plugin</artifactId>
          <version>${plugin.version.revapi}</version>
          <configuration>
            <checkDependencies>false</checkDependencies>
            <expandProperties>true</expandProperties>
            <analysisConfigurationFiles>
              <configurationFile>
                <path>${maven.multiModuleProjectDirectory}/revapi.json</path>
              </configurationFile>
            </analysisConfigurationFiles>
            <oldVersion>RELEASE</oldVersion>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.revapi</groupId>
              <artifactId>revapi-java</artifactId>
              <version>${version.revapi}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>check</id>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>

        <!-- dependency rules enforcement -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${plugin.version.enforcer}</version>
          <executions>
            <execution>
              <id>enforce-unique-dependencies</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <!-- see more https://maven.apache.org/enforcer/enforcer-rules/index.html -->
                <rules>
                  <banDuplicatePomDependencyVersions/>
                  <requireJavaVersion>
                    <version>[17,)</version>
                  </requireJavaVersion>
                  <requireMavenVersion>
                    <version>[3.6,)</version>
                  </requireMavenVersion>
                  <requireUpperBoundDeps/>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!--
          generate a simplified POM; this is very useful for projects consuming
          zeebe-test-container, as it will simplify dependency convergence for these projects
        -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>flatten-maven-plugin</artifactId>
          <version>${plugin.version.flatten}</version>
          <configuration>
            <flattenMode>ossrh</flattenMode>
          </configuration>
          <executions>
            <execution>
              <id>flatten</id>
              <goals>
                <goal>flatten</goal>
              </goals>
              <phase>process-resources</phase>
            </execution>
            <execution>
              <id>flatten.clean</id>
              <goals>
                <goal>clean</goal>
              </goals>
              <phase>clean</phase>
            </execution>
          </executions>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-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-surefire-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

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

    <profile>
      <id>parallel-tests</id>
      <properties>
        <forkCount>1C</forkCount>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <forkCount>${forkCount}</forkCount>
              <reuseForks>true</reuseForks>
              <properties>
                <configurationParameters>junit.jupiter.execution.parallel.enabled = true
                  junit.jupiter.execution.parallel.mode.default = concurrent
                  junit.jupiter.execution.parallel.config.strategy = fixed
                  junit.jupiter.execution.parallel.config.fixed.parallelism = 2</configurationParameters>
              </properties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!--
      this profile will run all tests annotated with @SmokeTest. the profile is mainly used to
      ensure that we can run basic tests on Windows, macOS, and Linux, thereby ensuring minimal
      multi-platform support for development.
      -->
    <profile>
      <id>local-test</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <failIfNoTests>false</failIfNoTests>
              <groups>local-test</groups>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
