<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.4.3</version>
    <relativePath />
  </parent>

  <groupId>org.camunda.community.rest</groupId>
  <artifactId>camunda-platform-7-rest-client-spring-boot-parent</artifactId>
  <version>7.20.0</version>
  <packaging>pom</packaging>
  <name>camunda-platform-7-rest-client-spring-boot/parent</name>
  <description>Camunda Platform 7 REST Client Spring-Boot</description>
  <url>https://github.com/camunda-community-hub/camunda-platform-7-rest-client-spring-boot/</url>

  <!-- License Stuff -->
  <inceptionYear>2019</inceptionYear>
  <organization>
    <name>Camunda Services GmbH</name>
  </organization>

  <properties>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>17</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <version.java>${java.version}</version.java>

    <camunda.version.base>7.20</camunda.version.base>
    <camunda.version.ce>${camunda.version.base}.0</camunda.version.ce>
    <camunda.version.ee>${camunda.version.base}.0-ee</camunda.version.ee>
    <spin.version>1.22.0</spin.version>

    <spring-boot.version>3.1.4</spring-boot.version>
    <spring-cloud.version>2022.0.4</spring-cloud.version>

    <kotlin.version>1.9.10</kotlin.version>
    <kotlin-logging.version>3.0.5</kotlin-logging.version>

    <!-- test tools -->
    <assertj.version>3.24.2</assertj.version>
    <mockito.version>5.6.0</mockito.version>
    <mockito-kotlin.version>5.1.0</mockito-kotlin.version>

    <pattern.class.itest>**/*ITest.*</pattern.class.itest>
    <pattern.package.itest>**/itest/**/*.*</pattern.package.itest>

    <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
    <!-- Skip instrumentalization by default -->
    <jacoco.skip>true</jacoco.skip>
  </properties>


  <modules>
    <module>extension/client</module>
    <module>extension/core</module>
    <module>extension/starter</module>
    <module>extension/starter-provided</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-bom</artifactId>
        <version>${kotlin.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </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>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring-cloud.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>${camunda.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine-rest-openapi</artifactId>
        <version>${camunda.version}</version>
      </dependency>
      <dependency>
        <groupId>org.camunda.spin</groupId>
        <artifactId>camunda-spin-bom</artifactId>
        <version>${spin.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.swagger.core.v3</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>2.2.16</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Kotlin -->
    <dependency>
      <groupId>io.github.microutils</groupId>
      <artifactId>kotlin-logging-jvm</artifactId>
      <version>${kotlin-logging.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-reflect</artifactId>
    </dependency>

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

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

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

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


  <build>

    <defaultGoal>clean jacoco:prepare-agent package</defaultGoal>

    <pluginManagement>
      <plugins>

        <!-- Coverage metering -->
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.10</version>
          <executions>
            <execution>
              <id>pre-unit-test</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>pre-integration-test</id>
              <goals>
                <goal>prepare-agent-integration</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <!-- java compiler -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.11.0</version>
          <configuration>
            <encoding>${project.build.sourceEncoding}</encoding>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
          </configuration>
          <executions>
            <!-- Replacing default-compile as it is treated specially by maven -->
            <execution>
              <id>default-compile</id>
              <phase>none</phase>
            </execution>
            <!-- Replacing default-testCompile as it is treated specially by maven -->
            <execution>
              <id>default-testCompile</id>
              <phase>none</phase>
            </execution>
            <execution>
              <id>java-compile</id>
              <phase>compile</phase>
              <goals>
                <goal>compile</goal>
              </goals>
            </execution>
            <execution>
              <id>java-test-compile</id>
              <phase>test-compile</phase>
              <goals>
                <goal>testCompile</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <!-- kotlin compiler -->
          <artifactId>kotlin-maven-plugin</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
          <version>${kotlin.version}</version>
          <configuration>
            <jvmTarget>${java.version}</jvmTarget>
            <compilerPlugins>
              <plugin>spring</plugin>
              <plugin>no-arg</plugin>
              <plugin>all-open</plugin>
            </compilerPlugins>
            <pluginOptions>
              <!-- Each annotation is placed on its own line -->
              <option>all-open:annotation=com.tngtech.jgiven.integration.spring.JGivenStage</option>
            </pluginOptions>
          </configuration>

          <executions>
            <execution>
              <id>kapt</id>
              <goals>
                <goal>kapt</goal>
              </goals>
              <configuration>
                <annotationProcessorPaths>
                  <annotationProcessorPath>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-configuration-processor</artifactId>
                    <version>${spring-boot.version}</version>
                  </annotationProcessorPath>
                </annotationProcessorPaths>
              </configuration>
            </execution>

            <execution>
              <id>compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                  <sourceDir>${project.basedir}/target/generated-sources/openapi/src/main/java</sourceDir>
                </sourceDirs>
              </configuration>
            </execution>
            <execution>
              <id>test-compile</id>
              <goals>
                <goal>test-compile</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                </sourceDirs>
              </configuration>
            </execution>
          </executions>

          <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>
        </plugin>

        <!-- Unit Tests -->
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.1.2</version>
          <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
            <runOrder>random</runOrder>
            <excludes>
              <exclude>${pattern.class.itest}</exclude>
              <exclude>${pattern.package.itest}</exclude>
            </excludes>
            <argLine>-Djava.awt.headless=true ${argLine} -XX:+StartAttachListener</argLine>
          </configuration>
        </plugin>

        <!-- ITests -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>3.1.2</version>
          <executions>
            <execution>
              <goals>
                <goal>integration-test</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <includes>
              <include>${pattern.class.itest}</include>
              <include>${pattern.package.itest}</include>
            </includes>
            <argLine>-Djava.awt.headless=true ${argLine} -XX:+StartAttachListener</argLine>
            <runOrder>random</runOrder>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring-boot.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>repackage</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!-- javadoc for kotlin -->
        <plugin>
          <groupId>org.jetbrains.dokka</groupId>
          <artifactId>dokka-maven-plugin</artifactId>
          <version>1.9.0</version>
          <executions>
            <execution>
              <phase>package</phase>
              <id>attach-javadocs</id>
              <goals>
                <goal>javadocJar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!-- sources from kotlin -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.4.0</version>
          <executions>
            <execution>
              <phase>generate-sources</phase>
              <goals>
                <goal>add-source</goal>
              </goals>
              <configuration>
                <sources>
                  <source>${project.basedir}/src/main/kotlin</source>
                </sources>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- attach sources -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.3.0</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <attach>true</attach>
                <forceCreation>true</forceCreation>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- License -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.2.0</version>
          <configuration>
            <licenseName>camunda_apache_v2</licenseName>
            <licenseResolver>${project.baseUri}src/license</licenseResolver>
            <inceptionYear>2019</inceptionYear>
            <roots>
              <root>src/main/kotlin</root>
              <root>src/test/kotlin</root>
            </roots>
          </configuration>
          <executions>
            <execution>
              <id>update-file-header</id>
              <goals>
                <goal>update-file-header</goal>
              </goals>
              <phase>process-sources</phase>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>com.google.code.maven-replacer-plugin</groupId>
          <artifactId>maven-replacer-plugin</artifactId>
          <version>1.4.1</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!--
    Profile to skip example publish
    -->
    <profile>
      <id>examples</id>
      <activation>
        <property>
          <name>!skipExamples</name>
        </property>
      </activation>
      <modules>
        <module>examples</module>
      </modules>
    </profile>
    <!--
    Profile for selecting the Camunda BPM Engine version.
    CE stands for Community Edition
    EE stands for Enterprise Edition
    -->
    <profile>
      <id>camunda-ce</id>
      <activation>
        <property>
          <name>!camunda-ee</name>
        </property>
      </activation>
      <properties>
        <camunda.version>${camunda.version.ce}</camunda.version>
      </properties>
    </profile>

    <profile>
      <id>camunda-ee</id>
      <activation>
        <property>
          <name>camunda-ee</name>
        </property>
      </activation>
      <properties>
        <camunda.version>${camunda.version.ee}</camunda.version>
      </properties>
      <repositories>
        <repository>
          <id>camunda-bpm-ee</id>
          <name>camunda-bpm-ee</name>
          <url>https://artifacts.camunda.com/artifactory/camunda-bpm-ee/</url>
        </repository>
      </repositories>
    </profile>

    <profile>
      <id>itest</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <defaultGoal>verify failsafe:verify</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!--
      Profile creating all artifacts: JARs, POMs, Sources, JavaDoc and all signatures.
      The parent pom already will call maven-source-plugin, maven-javadoc-plugin and maven-gpg-plugin.
    -->
    <profile>
      <id>community-action-maven-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jetbrains.dokka</groupId>
            <artifactId>dokka-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:camunda-community-hub/camunda-platform-7-client-spring-boot.git</connection>
    <url>scm:git:git@github.com:camunda-community-hub/camunda-platform-7-rest-client-spring-boot.git</url>
    <developerConnection>scm:git:git@github.com:camunda-community-hub/camunda-platform-7-rest-client-spring-boot.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

  <developers>
    <developer>
      <id>zambrovski</id>
      <name>Simon Zambrovski</name>
      <organization>Holisticon AG</organization>
      <roles>
        <role>Product Owner</role>
        <role>Maintainer</role>
      </roles>
      <organizationUrl>https://holisticon.de</organizationUrl>
    </developer>
    <developer>
      <id>rohwerj</id>
      <name>Jan Rohwer</name>
      <organization>Holisticon AG</organization>
      <roles>
        <role>Product Owner</role>
        <role>Maintainer</role>
      </roles>
      <organizationUrl>https://holisticon.de</organizationUrl>
    </developer>
  </developers>
</project>
