<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>pro.taskana</groupId>
  <artifactId>taskana-adapter-parent</artifactId>
  <version>1.10.0</version>
  <packaging>pom</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>This pom is parent to all taskana-camunda-adapter modules and serves the common
    build.
  </description>
  <url>http://taskana.pro</url>

  <developers>
    <developer>
      <name>Holger Hagen</name>
      <email>holger.hagen@novatec-gmbh.de</email>
      <organization>Novatec Consulting GmbH</organization>
      <organizationUrl>https://www.novatec-gmbh.de</organizationUrl>
    </developer>
  </developers>

  <scm>
    <url>http://github.com/taskana/taskanaadapter/tree/master</url>
    <connection>scm:git:git://github.com/taskana/taskanaadpter.git</connection>
    <developerConnection>scm:git:ssh://github.com:taskana/taskanaadapter.git</developerConnection>
  </scm>

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

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

    <version.taskana>4.13.0</version.taskana>

    <!-- build dependencies -->
    <version.checkstyle>9.2.1</version.checkstyle>
    <version.google-java-format>1.13.0</version.google-java-format>
    <version.maven.jar>3.2.2</version.maven.jar>
    <version.maven-war-plugin>3.3.2</version.maven-war-plugin>
    <version.maven.source>3.2.1</version.maven.source>
    <version.maven.compiler>3.9.0</version.maven.compiler>
    <version.maven.javadoc>3.3.1</version.maven.javadoc>
    <version.maven.failsafe.plugin>3.0.0-M5</version.maven.failsafe.plugin>
    <version.maven.surefire.plugin>3.0.0-M5</version.maven.surefire.plugin>
    <version.maven.checkstyle>3.1.2</version.maven.checkstyle>
    <version.maven.spring-boot>2.6.2</version.maven.spring-boot>
    <version.maven.sonar>3.9.1.2184</version.maven.sonar>

    <version.mybatis>3.5.9</version.mybatis>
    <version.spring.mybatis>2.2.1</version.spring.mybatis>
    <version.h2database>1.4.200</version.h2database>
    <version.db2>11.1.1.1</version.db2>
    <version.postgres>42.3.1</version.postgres>

    <version.spring>5.0.5.RELEASE</version.spring>
    <version.spring.core>2.0.0.RELEASE</version.spring.core>
    <version.spring.boot>2.6.2</version.spring.boot>

    <version.camunda>7.11.0</version.camunda>
    <version.camunda.bpm.spring.boot>3.3.10</version.camunda.bpm.spring.boot>
    <version.camunda.bpm.spring.boot.webapps>3.3.10</version.camunda.bpm.spring.boot.webapps>
    <version.camunda.bpm.spring.boot.test>3.3.10</version.camunda.bpm.spring.boot.test>
    <version.camunda.bpm.extensions>1.2</version.camunda.bpm.extensions>
    <version.camunda.spin.engine.plugin>7.11.0</version.camunda.spin.engine.plugin>
    <version.camunda.spin.dataformat.json.jackson>1.13.0</version.camunda.spin.dataformat.json.jackson>
    <version.camunda.spin>1.13.0</version.camunda.spin>
    <version.resteasy.spring.boot>5.0.0.Final</version.resteasy.spring.boot>
    <version.resteasy.jaxrs>3.0.12.Final</version.resteasy.jaxrs>
    <version.javax.servlet.api>4.0.1</version.javax.servlet.api>
    <version.javax.ws.rs.api>2.1.1</version.javax.ws.rs.api>
    <version.org.webjars.bootstrap>5.1.3</version.org.webjars.bootstrap>
    <version.org.jboss.spec>3.0.3.Final</version.org.jboss.spec>
    <version.wildfly>11.0.0.Final</version.wildfly>
    <version.wildfly.maven.plugin>2.1.0.Final</version.wildfly.maven.plugin>
    <version.jboss-as-maven-plugin>7.9.Final</version.jboss-as-maven-plugin>

    <version.assertj>3.22.0</version.assertj>
    <version.junit.jupiter>5.8.2</version.junit.jupiter>
    <version.hamcrest.json>0.2</version.hamcrest.json>

    <version.maven.gpg>3.0.1</version.maven.gpg>
    <version.sonatype>1.6.8</version.sonatype>
    <version.jacoco>0.8.7</version.jacoco>

    <!-- sonar settings -->
    <!--suppress UnresolvedMavenProperty -->
    <sonar.projectKey>${env.SONAR_PROJECT_KEY}</sonar.projectKey>
    <!--suppress UnresolvedMavenProperty -->
    <sonar.organization>${env.SONAR_ORGANIZATION}</sonar.organization>
    <sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
    <sonar.coverage.jacoco.xmlReportPaths>
      ${project.basedir}/ci/taskana-adapter-sonar-test-coverage/target/site/jacoco-aggregate/jacoco.xml,
      ${project.basedir}/../ci/taskana-adapter-sonar-test-coverage/target/site/jacoco-aggregate/jacoco.xml,
      ${project.basedir}/../../ci/taskana-adapter-sonar-test-coverage/target/site/jacoco-aggregate/jacoco.xml
    </sonar.coverage.jacoco.xmlReportPaths>
    <sonar.sources>src/main/java</sonar.sources>
  </properties>

  <modules>
    <module>taskana-adapter</module>
    <module>taskana-adapter-camunda-system-connector</module>
    <module>taskana-adapter-taskana-connector</module>
    <module>taskana-adapter-camunda-spring-boot-example</module>
    <module>taskana-adapter-camunda-listener</module>
    <module>taskana-adapter-camunda-listener-example</module>
    <module>taskana-adapter-camunda-outbox-rest</module>
    <module>taskana-adapter-camunda-outbox-rest-spring-boot-starter</module>
    <module>taskana-adapter-camunda-wildfly-example</module>
    <module>taskana-adapter-camunda-spring-boot-test</module>
    <module>camunda-outbox-example-boot</module>
    <module>ci/taskana-adapter-sonar-test-coverage</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${version.spring.boot}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <!-- Only necessary to automatically update the version for the pre-commit hook -->
      <dependency>
        <groupId>com.google.googlejavaformat</groupId>
        <artifactId>google-java-format</artifactId>
        <version>${version.google-java-format}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>jdk8-compatibility</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <properties>
        <maven.compiler.release>8</maven.compiler.release>
        <maven.compiler.testRelease>${java.version}</maven.compiler.testRelease>
      </properties>
    </profile>
    <profile>
      <id>snapshot</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.maven.gpg}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <!-- The pinentry-mode loopback is necessary to specify and use a passphrase with a gpg key -->
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${version.sonatype}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.maven.gpg}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <!-- The pinentry-mode loopback is necessary to specify and use a passphrase with a gpg key -->
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${version.sonatype}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>${version.maven.sonar}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${version.jacoco}</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!--
      This plugin appends version information into the jar, so that it can be extracted from the jar.
      See TSK-837 for more information
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${version.maven.jar}</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.maven.compiler}</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
          <showWarnings>true</showWarnings>
          <failOnWarning>true</failOnWarning>
          <compilerArgs>
            <arg>-Xlint:-serial</arg>
            <arg>-proc:none</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${version.maven.source}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.maven.javadoc}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.maven.surefire.plugin}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${version.maven.checkstyle}</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${version.checkstyle}</version>
          </dependency>
        </dependencies>
        <configuration>
          <configLocation>qa/checkstyle/checkstyle.xml</configLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <violationSeverity>warning</violationSeverity>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
        </configuration>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>snapshots-repo</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
</project>
