<?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.holunda.taskpool</groupId>
  <artifactId>camunda-bpm-taskpool</artifactId>
  <version>2.1.1</version>
  <packaging>pom</packaging>

  <name>${project.artifactId}</name>
  <description>Camunda BPM Taskpool</description>
  <url>https://github.com/holunda-io/camunda-bpm-taskpool/</url>

  <properties>
    <skipFrontend>true</skipFrontend>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>11</java.version>
    <version.java>${java.version}</version.java>

    <pattern.class.itest>**/*ITest.*</pattern.class.itest>
    <pattern.package.itest>**/itest/**/*.*</pattern.package.itest>
    <npm.version>6.14.8</npm.version>
    <node.version>v10.22.0</node.version>

    <!--
    <camunda-ee>false</camunda-ee>
    Use the system property: -Dcamunda-ee to enable EE
    -->
    <camunda-ce.version>7.13.0</camunda-ce.version>
    <camunda-ee.version>7.13.0-ee</camunda-ee.version>
    <camunda-springboot.version>${camunda-ce.version}</camunda-springboot.version>
    <camunda-bpm-assert.version>6.0.0</camunda-bpm-assert.version>
    <camunda-bpm-mockito.version>4.13.0</camunda-bpm-mockito.version>
    <camunda-bpm-data.version>1.0.2</camunda-bpm-data.version>
    <version.camunda.spin>1.9.0</version.camunda.spin>

    <springboot.version>2.2.9.RELEASE</springboot.version>
    <spring-framework.version>5.2.8.RELEASE</spring-framework.version>
    <project-reactor.version>3.3.8.RELEASE</project-reactor.version>

    <axon.version>4.4.3</axon.version>
    <axon-kotlin.version>0.1.0</axon-kotlin.version>
    <axon-gateway-extension.version>0.0.4</axon-gateway-extension.version>

    <kotlin.version>1.4.10</kotlin.version>
    <kotlin.compiler.jvmTarget>${java.version}</kotlin.compiler.jvmTarget>
    <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
    <kotlin-logging.version>2.0.3</kotlin-logging.version>

    <springboot-swagger-starter.version>0.3.0</springboot-swagger-starter.version>
    <org.mapstruct.version>1.4.0.Final</org.mapstruct.version>

    <mockito.version>2.23.4</mockito.version>
    <mockito-kotlin.version>2.2.0</mockito-kotlin.version>
    <awaitability.version>3.1.5</awaitability.version>

  </properties>

  <modules>
    <module>engine</module>
    <module>taskpool</module>
    <module>datapool</module>
    <module>view</module>
  </modules>

  <dependencyManagement>
    <dependencies>

      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-taskpool-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-taskpool-event</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-taskpool-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-taskpool-collector</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-engine-client</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-taskpool-variable-serializer</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-datapool-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-datapool-event</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-datapool-collector</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-datapool-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-taskpool-view-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-taskpool-view-simple</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holunda.taskpool</groupId>
        <artifactId>camunda-bpm-taskpool-view-mongo</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <!-- first: Import dependency management from Kotlin -->
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-bom</artifactId>
        <version>${kotlin.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <!-- second: Import dependency management from SpringBoot (if done prior kotlin, it will overwrite it) -->
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${springboot.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>

      <dependency>
        <!-- finally: Import dependency management from Camunda -->
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>${camunda.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>

      <dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter</artifactId>
        <version>${camunda-springboot.version}</version>
      </dependency>

      <dependency>
        <groupId>io.holunda.data</groupId>
        <artifactId>camunda-bpm-data</artifactId>
        <version>${camunda-bpm-data.version}</version>
      </dependency>

      <!-- MapStruct -->
      <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct</artifactId>
        <version>${org.mapstruct.version}</version>
      </dependency>

      <!-- Axon Framework -->
      <!-- https://mvnrepository.com/artifact/org.axonframework/axon -->
      <dependency>
        <groupId>org.axonframework</groupId>
        <artifactId>axon-messaging</artifactId>
        <version>${axon.version}</version>
      </dependency>
      <dependency>
        <groupId>org.axonframework.extensions.kotlin</groupId>
        <artifactId>axon-kotlin</artifactId>
        <version>${axon-kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.axonframework</groupId>
        <artifactId>axon-spring</artifactId>
        <version>${axon.version}</version>
      </dependency>
      <dependency>
        <groupId>org.axonframework</groupId>
        <artifactId>axon-eventsourcing</artifactId>
        <version>${axon.version}</version>
      </dependency>
      <dependency>
        <groupId>org.axonframework</groupId>
        <artifactId>axon-configuration</artifactId>
        <version>${axon.version}</version>
      </dependency>

      <dependency>
        <groupId>org.axonframework</groupId>
        <artifactId>axon-spring-boot-starter</artifactId>
        <version>${axon.version}</version>
      </dependency>
      <dependency>
        <groupId>org.axonframework</groupId>
        <artifactId>axon-modelling</artifactId>
        <version>${axon.version}</version>
      </dependency>

      <dependency>
        <groupId>io.holixon</groupId>
        <artifactId>axon-gateway-extension</artifactId>
        <version>${axon-gateway-extension.version}</version>
      </dependency>
      <dependency>
        <groupId>io.holixon</groupId>
        <artifactId>axon-gateway-spring-boot-starter</artifactId>
        <version>${axon-gateway-extension.version}</version>
      </dependency>

      <!-- Swagger -->
      <dependency>
        <groupId>io.toolisticon.springboot</groupId>
        <artifactId>springboot-swagger-starter</artifactId>
        <version>${springboot-swagger-starter.version}</version>
      </dependency>

      <!-- Logging -->
      <dependency>
        <groupId>io.github.microutils</groupId>
        <artifactId>kotlin-logging-jvm</artifactId>
        <version>${kotlin-logging.version}</version>
      </dependency>

      <!-- Testing -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-inline</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.axonframework</groupId>
        <artifactId>axon-test</artifactId>
        <version>${axon.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-test</artifactId>
        <version>${kotlin.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-test-junit</artifactId>
        <version>${kotlin.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.nhaarman.mockitokotlin2</groupId>
        <artifactId>mockito-kotlin</artifactId>
        <version>${mockito-kotlin.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter-test</artifactId>
        <version>${camunda-springboot.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <version>${springboot.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.camunda.bpm.extension.mockito</groupId>
        <artifactId>camunda-bpm-mockito</artifactId>
        <version>${camunda-bpm-mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.camunda.bpm.assert</groupId>
        <artifactId>camunda-bpm-assert</artifactId>
        <version>${camunda-bpm-assert.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <version>${awaitability.version}</version>
        <scope>test</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Kotlin -->
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-reflect</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.microutils</groupId>
      <artifactId>kotlin-logging-jvm</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <defaultGoal>clean jacoco:prepare-agent package</defaultGoal>
    <pluginManagement>
      <plugins>
        <plugin>
          <!-- cleaning -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <!-- for generating stubs -->
          <groupId>io.swagger</groupId>
          <artifactId>swagger-codegen-maven-plugin</artifactId>
          <version>2.4.8</version>
        </plugin>

        <plugin>
          <!-- validate swagger -->
          <groupId>com.github.sylvainlaurent.maven</groupId>
          <artifactId>swagger-validator-maven-plugin</artifactId>
          <version>1.2.6</version>
          <executions>
            <execution>
              <id>validate</id>
              <phase>validate</phase>
              <goals>
                <goal>validate</goal>
              </goals>
              <configuration>
                <failOnErrors>true</failOnErrors>
                <includes>
                  <include>src/main/resources/swagger.yml</include>
                  <!-- other <include> may be added -->
                </includes>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- Coverage metering -->
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.6</version>
          <executions>
            <!--
                Prepares the property pointing to the JaCoCo runtime agent which
                is passed as VM argument when Maven the Surefire plugin is executed.
            -->
            <execution>
              <id>pre-unit-test</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <!-- Sets the path to the file which contains the execution data. -->
                <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
                <!--
                    Sets the name of the property containing the settings
                    for JaCoCo runtime agent.
                -->
                <propertyName>surefireArgLine</propertyName>
              </configuration>
            </execution>
            <!--
                Ensures that the code coverage report for unit tests is created after
                unit tests have been run.
            -->
            <execution>
              <id>post-unit-test</id>
              <phase>test</phase>
              <goals>
                <goal>report</goal>
              </goals>
              <configuration>
                <!-- Sets the path to the file which contains the execution data. -->
                <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
                <!-- Sets the output directory for the code coverage report. -->
                <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                <excludes>
                  <exclude>${pattern.package.itest}</exclude>
                  <exclude>${pattern.class.itest}</exclude>
                </excludes>
              </configuration>
            </execution>
            <!-- The Executions required by unit tests are omitted. -->
            <!--
                Prepares the property pointing to the JaCoCo runtime agent which
                is passed as VM argument when Maven the Failsafe plugin is executed.
            -->
            <execution>
              <id>pre-integration-test</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <!-- Sets the path to the file which contains the execution data. -->
                <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
                <!--
                    Sets the name of the property containing the settings
                    for JaCoCo runtime agent.
                -->
                <propertyName>failsafeArgLine</propertyName>
              </configuration>
            </execution>
            <!--
                Ensures that the code coverage report for integration tests after
                integration tests have been run.
            -->
            <execution>
              <id>post-integration-test</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>report</goal>
              </goals>
              <configuration>
                <!-- Sets the path to the file which contains the execution data. -->
                <dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
                <!-- Sets the output directory for the code coverage report. -->
                <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                <excludes>
                  <exclude>${pattern.package.itest}</exclude>
                  <exclude>${pattern.class.itest}</exclude>
                </excludes>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <!-- java compiler -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <encoding>UTF-8</encoding>
            <source>${java.version}</source>
            <target>${java.version}</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>
          <!-- resources -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <encoding>UTF-8</encoding>
          </configuration>
        </plugin>

        <plugin>
          <!-- jar -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              </manifest>
            </archive>
          </configuration>
        </plugin>

        <plugin>
          <!-- for packaging springboot application -->
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${springboot.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>repackage</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <excludes>
              <exclude>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
              </exclude>
              <exclude>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
              </exclude>
              <exclude>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
              </exclude>
              <exclude>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
              </exclude>
            </excludes>
          </configuration>
        </plugin>

        <plugin>
          <!-- for loading and unpacking artifacts -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>

        <plugin>
          <groupId>com.coderplus.maven.plugins</groupId>
          <artifactId>copy-rename-maven-plugin</artifactId>
          <version>1.0.1</version>
        </plugin>

        <plugin>
          <!-- for running npm build -->
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>1.8.0</version>
        </plugin>

        <plugin>
          <!-- kotlin compiler -->
          <artifactId>kotlin-maven-plugin</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
          <version>${kotlin.version}</version>
          <configuration>
            <compilerPlugins>
              <plugin>spring</plugin>
              <plugin>jpa</plugin>
              <plugin>no-arg</plugin>
              <plugin>all-open</plugin>
            </compilerPlugins>
            <pluginOptions>
              <option>all-open:annotation=org.axonframework.eventhandling.EventHandler</option>
              <option>all-open:annotation=org.axonframework.queryhandling.QueryHandler</option>
              <option>all-open:annotation=com.tngtech.jgiven.integration.spring.JGivenStage</option>
            </pluginOptions>
            <jvmTarget>${java.version}</jvmTarget>
          </configuration>
          <executions>
            <execution>
              <id>kapt</id>
              <goals>
                <goal>kapt</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/target/generated-sources/swagger/src/main/java</sourceDir>
                  <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                </sourceDirs>
                <annotationProcessorPaths>
                  <annotationProcessorPath>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-configuration-processor</artifactId>
                    <version>${springboot.version}</version>
                  </annotationProcessorPath>
                </annotationProcessorPaths>
              </configuration>
            </execution>
            <execution>
              <id>compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/target/generated-sources/swagger/src/main/java</sourceDir>
                  <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>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.7</version>
          <configuration>
            <generateBackupPoms>false</generateBackupPoms>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <!--
            <forkCount>0</forkCount>
            -->
            <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
              ${surefireArgLine}
              -XX:+StartAttachListener
            </argLine>
            <systemPropertyVariables>
              <jgiven.report.dir>${project.build.directory}/jgiven-reports</jgiven.report.dir>
            </systemPropertyVariables>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <!--
            <forkCount>0</forkCount>
            -->
          </configuration>
        </plugin>

        <!-- gitflow -->
        <plugin>
          <groupId>com.amashchenko.maven.plugin</groupId>
          <artifactId>gitflow-maven-plugin</artifactId>
          <version>1.14.0</version>
          <configuration>
            <gitFlowConfig>
              <productionBranch>master</productionBranch>
              <developmentBranch>develop</developmentBranch>
              <featureBranchPrefix>feature/</featureBranchPrefix>
              <releaseBranchPrefix>release/</releaseBranchPrefix>
              <hotfixBranchPrefix>hotfix/</hotfixBranchPrefix>
              <supportBranchPrefix>support/</supportBranchPrefix>
              <origin>origin</origin>
            </gitFlowConfig>
            <useSnapshotInHotfix>true</useSnapshotInHotfix>
            <useSnapshotInRelease>true</useSnapshotInRelease>
            <keepBranch>false</keepBranch>
            <pushRemote>true</pushRemote>
          </configuration>
        </plugin>

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

        <!-- source 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.2.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>

        <!-- To sign the artifacts -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
          <configuration>
            <keyname>${gpg.keyname}</keyname>
            <gpgArguments>
              <arg>--batch</arg>
              <arg>--yes</arg>
              <arg>--pinentry-mode</arg>
              <arg>loopback</arg>
            </gpgArguments>
          </configuration>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
        </plugin>


        <!-- Deploy -->
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.8</version>
          <executions>
            <execution>
              <id>default-deploy</id>
              <phase>deploy</phase>
              <goals>
                <goal>deploy</goal>
              </goals>
              <configuration>
                <serverId>ossrh</serverId>
                <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                <autoReleaseAfterClose>true</autoReleaseAfterClose>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- Install -->
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>

        <!-- Enforce -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.4.2.jenkins-1</version>
          <executions>
            <execution>
              <id>enforce-maven</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <version>3.6.0</version>
                  </requireMavenVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <profile>
      <id>itest</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <skipFrontend>true</skipFrontend>
      </properties>
      <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 integration tests are run. -->
              <!-- prevent the annoying ForkedBooter process from stealing window focus on Mac OS -->
              <argLine>
                -Djava.awt.headless=true ${failsafeArgLine}
              </argLine>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>generate-sql</id>
      <build>
        <plugins>
          <plugin>
            <groupId>de.juplo</groupId>
            <artifactId>hibernate-maven-plugin</artifactId>
            <version>2.1.1</version>
            <executions>
              <execution>
                <id>generate-h2-ddl</id>
                <goals>
                  <goal>create</goal>
                </goals>
                <configuration>
                  <dialect>org.hibernate.dialect.H2Dialect</dialect>
                  <physicalNamingStrategy>
                    org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
                  </physicalNamingStrategy>
                  <execute>false</execute>
                  <show>true</show>
                  <format>true</format>
                  <outputFile>h2_ddl.sql</outputFile>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!--
    Profile creating all artifacts: JARs, POMs, Sources, JavaDoc and all signatures.
    -->
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>release</name>
        </property>
      </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>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </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-ce.version}</camunda.version>
      </properties>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.camunda.bpm.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
            <version>${camunda.version}</version>
          </dependency>
        </dependencies>
      </dependencyManagement>
    </profile>

    <profile>
      <id>camunda-ee</id>
      <activation>
        <property>
          <name>camunda-ee</name>
        </property>
      </activation>
      <properties>
        <camunda.version>${camunda-ee.version}</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.version}</version>
          </dependency>
        </dependencies>
      </dependencyManagement>
    </profile>

    <profile>
      <id>docs</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>docs</module>
      </modules>
    </profile>

    <profile>
      <id>examples</id>
      <activation>
        <property>
          <name>!skipExamples</name>
        </property>
      </activation>
      <modules>
        <module>examples</module>
      </modules>
    </profile>

  </profiles>

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

  <scm>
    <connection>scm:git:git@github.com:holunda-io/camunda-bpm-taskpool.git</connection>
    <url>scm:git:git@github.com:holunda-io/camunda-bpm-taskpool.git</url>
    <developerConnection>scm:git:git@github.com:holunda-io/camunda-bpm-taskpool.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

  <distributionManagement>
    <site>
      <id>README</id>
      <url>https://github.com/holunda-io/camunda-bpm-taskpool</url>
    </site>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </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>
  <repositories>
    <!-- Swagger Snapshots only-->
    <repository>
      <id>jfrog-snapshots</id>
      <name>JFrog</name>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
    </repository>
  </repositories>
  <developers>
    <developer>
      <id>zambrovski</id>
      <name>Simon Zambrovski</name>
      <email>simon.zambrovski@holisticon.de</email>
      <organization>Holisticon AG</organization>
      <organizationUrl>http://www.holisticon.de</organizationUrl>
    </developer>
    <developer>
      <id>jangalinski</id>
      <name>Jan Galinski</name>
      <email>jan.galinski@holisticon.de</email>
      <organization>Holisticon AG</organization>
      <organizationUrl>http://www.holisticon.de</organizationUrl>
    </developer>
    <developer>
      <id>dthuesen</id>
      <name>Detlef von Thuesen</name>
      <email>dthuesen@gmx.de</email>
      <organization>Holisticon AG</organization>
      <organizationUrl>http://www.holisticon.de</organizationUrl>
    </developer>
    <developer>
      <id>bignesta</id>
      <name>Christoph Wolff</name>
      <organization>Holisticon AG</organization>
      <organizationUrl>http://www.holisticon.de</organizationUrl>
    </developer>
    <developer>
      <id>lbilger</id>
      <name>Lars Bilger</name>
    </developer>
    <developer>
      <id>a-hegerath</id>
      <name>Andre Hegerath</name>
      <email>ah@hbt.de</email>
      <organization>HBT GmbH</organization>
      <organizationUrl>https://www.hbt.de/</organizationUrl>
    </developer>
  </developers>
</project>
