<?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>
  <name>Zeebe Exporter Protobuf Schema</name>
  <groupId>io.zeebe</groupId>
  <artifactId>zeebe-exporter-protobuf</artifactId>
  <version>1.4.0</version>
  <packaging>jar</packaging>

  <url>https://github.com/camunda-community-hub/zeebe-exporter-protobuf</url>
  <inceptionYear>2019</inceptionYear>

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

  <properties>

    <!-- release parent settings -->
    <version.java>11</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>

    <!-- license header -->
    <license.header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</license.header>

    <!-- project dependencies -->
    <version.zeebe>8.2.0</version.zeebe>

    <version.protobuf>3.22.2</version.protobuf>
    <version.protoc>3.9.1</version.protoc>
    <version.slf4j>1.7.25</version.slf4j>

    <version.assertj>3.24.2</version.assertj>
    <version.junit>4.13.2</version.junit>
    <version.log4j>2.11.1</version.log4j>
    <version.mockito>5.2.0</version.mockito>

    <!-- plugin version -->
    <plugin.version.checkstyle>3.2.1</plugin.version.checkstyle>
    <plugin.version.enforcer>3.0.0-M2</plugin.version.enforcer>
    <plugin.version.failsafe>2.22.2</plugin.version.failsafe>
    <plugin.version.fmt>2.13</plugin.version.fmt>
    <plugin.version.license>4.2</plugin.version.license>
    <plugin.version.protobuf-maven-plugin>0.6.1</plugin.version.protobuf-maven-plugin>
    <plugin.version.surefire>3.0.0</plugin.version.surefire>
    <plugin.version.resources>3.3.1</plugin.version.resources>
    <plugin.version.shade>3.4.1</plugin.version.shade>

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

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

      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java-util</artifactId>
        <version>${version.protobuf}</version>
      </dependency>

      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${version.protobuf}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.camunda</groupId>
      <artifactId>zeebe-exporter-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>

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

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${version.mockito}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>${extension.version.os-maven-plugin}</version>
      </extension>
    </extensions>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.12.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.4.2</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.13</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>

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

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.5.0</version>
        <configuration>
          <source>${version.java}</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>

      <!-- Protobuf plugin -->
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>${plugin.version.protobuf-maven-plugin}</version>
        <configuration>
          <protocArtifact>
            com.google.protobuf:protoc:${version.protoc}:exe:${os.detected.classifier}
          </protocArtifact>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </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>
      </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>
        <configuration>
          <additionalSourceDirectories>
            <additionalSourceDirectory>${project.basedir}/src/test/jmh
            </additionalSourceDirectory>
          </additionalSourceDirectories>
        </configuration>
      </plugin>

      <!-- Shade Plugin -->
      <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>

      <!-- LICENSE PLUGIN -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${plugin.version.license}</version>
        <configuration>
          <header>${license.header}</header>
          <properties>
            <owner>camunda services GmbH</owner>
            <email>info@camunda.com</email>
          </properties>
          <includes>
            <include>**/*.java</include>
          </includes>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
          </mapping>
        </configuration>
        <executions>
          <execution>
            <id>add-license</id>
            <phase>compile</phase>
            <goals>
              <goal>format</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>

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

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