<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</groupId>
    <artifactId>camunda-release-parent</artifactId>
    <version>3.7</version>
    <relativePath />
  </parent>

  <groupId>org.camunda.bpm.extension.rest</groupId>
  <artifactId>camunda-rest-client-spring-boot-parent</artifactId>
  <version>0.0.3</version>
  <packaging>pom</packaging>
  <name>${project.artifactId}</name>
  <description>Camunda REST Client Spring-Boot</description>
  <url>https://github.com/camunda/camunda-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>1.8</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-ee>false</camunda-ee>
    <camunda.version>7.11.0</camunda.version>
    <camunda.version.ee>7.11.1-ee</camunda.version.ee>

    <spring-boot.version>2.1.5.RELEASE</spring-boot.version>
    <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
    <camunda-external-client.version>1.2.2</camunda-external-client.version>
    <camunda-spring-boot.version>3.3.1</camunda-spring-boot.version>
    <groovy.version>2.4.5</groovy.version>
    <spin.version>1.7.1</spin.version>
    <kotlin.version>1.3.50</kotlin.version>
    <kotlin-logging.version>1.6.22</kotlin-logging.version>
    <slf4j.version>1.7.25</slf4j.version>

    <!-- test tools -->
    <assertj.version>3.11.1</assertj.version>
    <mockito.version>2.21.0</mockito.version>

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

    <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
    <!-- disable javadoc linter for JDK8 to not fail on incomplete javadoc -->
    <additionalparam>-Xdoclint:none</additionalparam>
    <!-- Skip instrumentalization by default -->
    <jacoco.skip>true</jacoco.skip>
  </properties>


  <modules>
    <module>extension</module>
    <module>starter</module>
    <module>starter-provided</module>
    <module>examples</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <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.spin</groupId>
        <artifactId>camunda-spin-bom</artifactId>
        <scope>import</scope>
        <type>pom</type>
        <version>${spin.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

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

    <!-- Testing -->
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.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.4</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>
          <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>jpa</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>compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/src/main/kotlin</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>2.22.1</version>
          <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
            <runOrder>random</runOrder>
            <excludes>
              <exclude>${pattern.class.itest}</exclude>
              <exclude>${pattern.package.itest}</exclude>
            </excludes>
            <!-- Sets the VM argument line used when unit tests are run. -->
            <!-- prevent the annoying ForkedBooter process from stealing window focus on Mac OS -->
            <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>2.18.1</version>
        </plugin>

        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <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>0.9.13</version>
          <executions>
            <execution>
              <phase>test</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.0.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.0.1</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>

        <!-- Deploy -->
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>

        <!-- License -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.0.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>
      </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 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>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
            <version>${camunda-spring-boot.version}</version>
          </dependency>
        </dependencies>
      </dependencyManagement>
    </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://app.camunda.com/nexus/content/repositories/camunda-bpm-ee</url>
        </repository>
      </repositories>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-webapp-ee</artifactId>
            <version>${camunda-spring-boot.version}</version>
          </dependency>
        </dependencies>
      </dependencyManagement>
    </profile>

    <profile>
      <id>itest</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <defaultGoal>integration-test failsafe:verify</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <!-- Skip Unit test execution on ITest profile run -->
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <includes>
                <include>${pattern.class.itest}</include>
                <include>${pattern.package.itest}</include>
              </includes>
              <!-- Sets the VM argument line used when unit tests are run. -->
              <!-- prevent the annoying ForkedBooter process from stealing window focus on Mac OS -->
              <argLine>-Djava.awt.headless=true ${argLine} -XX:+StartAttachListener</argLine>
              <runOrder>random</runOrder>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>docs</id>
      <modules>
        <module>docs</module>
      </modules>
    </profile>

    <!--
      Profile creating all artifacts: JARs, POMs, Sources, JavaDoc and all signatures.
    -->
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <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>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

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

  <scm>
    <connection>scm:git:git@github.com:camunda/camunda-rest-client-spring-boot.git</connection>
    <url>scm:git:git@github.com:camunda/camunda-rest-client-spring-boot.git</url>
    <developerConnection>scm:git:git@github.com:camunda/camunda-rest-client-spring-boot.git</developerConnection>
    <tag>0.0.3</tag>
  </scm>

  <!-- repositories used for distribution of releases and snapshots, DO NOT CHANGE -->
  <distributionManagement>
    <repository>
      <id>camunda-nexus</id>
      <name>Camunda BPM Community extensions</name>
      <url>https://app.camunda.com/nexus/content/repositories/camunda-bpm-community-extensions</url>
    </repository>
    <snapshotRepository>
      <id>camunda-nexus</id>
      <name>Camunda BPM Community extensions snapshots</name>
      <url>https://app.camunda.com/nexus/content/repositories/camunda-bpm-community-extensions-snapshots</url>
      <!-- for maven 2 compatibility -->
      <uniqueVersion>true</uniqueVersion>
    </snapshotRepository>
  </distributionManagement>


  <pluginRepositories>
    <!-- required for Dokka (Kotlin javadoc) -->
    <pluginRepository>
      <id>jcenter</id>
      <name>JCenter</name>
      <url>https://jcenter.bintray.com/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
    </pluginRepository>
  </pluginRepositories>

  <developers>
    <developer>
      <name>Simon Zambrovski</name>
      <organization>Holisticon AG</organization>
      <roles>
        <role>Maintainer</role>
      </roles>
      <organizationUrl>https://holisticon.de</organizationUrl>
    </developer>
  </developers>
</project>
