<?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.bpmn-spec</groupId>
  <artifactId>root</artifactId>
  <version>1.0.0</version>
  <name>BPMN Spec - Root</name>
  <description>A tool to write tests for BPMN workflows</description>

  <packaging>pom</packaging>

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

  <modules>
    <module>core</module>
    <module>zeebe-test-runner</module>
    <module>junit-extension</module>
  </modules>

  <properties>
    <kotlin.version>1.4.30</kotlin.version>
    <zeebe.version>0.26.1</zeebe.version>

    <spring.boot.version>2.4.3</spring.boot.version>
    <junit.version>5.7.1</junit.version>

    <hazelcast.exporter.version>0.9.0</hazelcast.exporter.version>
    <!-- pin Hazelcast version because of spring-boot-dependencies -->
    <version.hazelcast>4.0.1</version.hazelcast>

    <zeebe-test-container.version>1.0.1</zeebe-test-container.version>
    <test-container.version>1.15.2</test-container.version>

    <!-- release parent settings -->
    <version.java>11</version.java>
    <nexus.snapshot.repository>
      https://app.camunda.com/nexus/content/repositories/zeebe-io-snapshots/
    </nexus.snapshot.repository>
    <nexus.release.repository>https://app.camunda.com/nexus/content/repositories/zeebe-io/
    </nexus.release.repository>

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

  </properties>

  <dependencyManagement>
    <dependencies>

      <dependency>
        <groupId>io.zeebe.bpmn-spec</groupId>
        <artifactId>core</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>io.zeebe.bpmn-spec</groupId>
        <artifactId>zeebe-test-runner</artifactId>
        <version>${project.version}</version>
      </dependency>

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

      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring.boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>2.12.1</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

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

      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers</artifactId>
        <version>1.15.2</version>
      </dependency>

      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${test-container.version}</version>
      </dependency>

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

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

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

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

      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.19.0</version>
      </dependency>

      <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility-kotlin</artifactId>
        <version>4.0.3</version>
      </dependency>

      <!-- Kotlin deps -->

      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib</artifactId>
        <version>${kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib-common</artifactId>
        <version>${kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-reflect</artifactId>
        <version>${kotlin.version}</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <!-- common dependencies -->
  <dependencies>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-reflect</artifactId>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
    <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>

    <plugins>

      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <version>${kotlin.version}</version>
        <configuration>
          <args>
            <arg>-Xjsr305=strict</arg>
          </args>
          <compilerPlugins>
            <plugin>spring</plugin>
            <plugin>jpa</plugin>
          </compilerPlugins>
          <jvmTarget>11</jvmTarget>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-allopen</artifactId>
            <version>${kotlin.version}</version>
          </dependency>
          <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-noarg</artifactId>
            <version>${kotlin.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>

          <execution>
            <id>test-compile</id>
            <goals>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <release>11</release>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <!-- Override java source version to workaround javadoc bug https://bugs.openjdk.java.net/browse/JDK-8212233 -->
          <source>8</source>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>empty-javadoc-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>javadoc</classifier>
              <classesDirectory>${basedir}/javadoc</classesDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <properties>
        <plugin.version.gpg>1.6</plugin.version.gpg>
        <gpg.passphrase>${env.GPG_PASS}</gpg.passphrase>
        <resume>false</resume>
        <tag>${env.RELEASE_VERSION}</tag>
        <releaseVersion>${env.RELEASE_VERSION}</releaseVersion>
        <developmentVersion>${env.DEVELOPMENT_VERSION}</developmentVersion>
        <arguments>-DskipTests</arguments>
      </properties>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <configuration>
                <gpgArguments>
                  <arg>--pinentry-mode</arg>
                  <arg>loopback</arg>
                </gpgArguments>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </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/bpmn-spec</url>
    <connection>scm:git:git@github.com:zeebe-io/bpmn-spec.git</connection>
    <developerConnection>scm:git:git@github.com:zeebe-io/bpmn-spec.git</developerConnection>
    <tag>1.0.0</tag>
  </scm>

</project>