<?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.muenchendigital.digiwf</groupId>
    <artifactId>digiwf-core</artifactId>
    <version>0.17.13</version>
    <name>digiwf-core</name>
    <packaging>pom</packaging>
    <description>DigiWF Core Services</description>
    <url>https://github.com/it-at-m/digiwf-core</url>

    <properties>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.source>11</maven.compiler.source>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring-boot.version>2.7.11</spring-boot.version>
        <spring.cloud.version>2021.0.5</spring.cloud.version>
        <okhttp.version>4.10.0</okhttp.version>
        <lombok.version>1.18.26</lombok.version>
        <lombok.mapstruct.binding.version>0.2.0</lombok.mapstruct.binding.version>
        <org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
        <camunda.version.ce>7.18.0</camunda.version.ce>
        <camunda.version>${camunda.version.ce}</camunda.version>
        <camunda.version.ee>7.18.0-ee</camunda.version.ee>
        <camunda-engine-rest-client-openapi-java.version>7.18.0</camunda-engine-rest-client-openapi-java.version>
        <springdoc-openapi.version>1.7.0</springdoc-openapi.version>
        <tika.version>2.7.0</tika.version>
    </properties>

    <modules>
        <module>digiwf-engine</module>
        <module>digiwf-connector</module>
        <module>digiwf-schema-registry</module>
        <module>digiwf-task</module>
        <module>digiwf-libs</module>
        <module>digiwf-process</module>
        <module>digiwf-gateway</module>
        <module>digiwf-integrations</module>
        <module>digiwf-coverage</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <!-- Import dependency management from Spring Cloud -->
                <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>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <!-- Open API -->
            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-webflux-ui</artifactId>
                <version>${springdoc-openapi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-ui</artifactId>
                <version>${springdoc-openapi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-security</artifactId>
                <version>${springdoc-openapi.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>3.0.2</version>
            </dependency>
            <dependency>
                <groupId>org.openapitools</groupId>
                <artifactId>jackson-databind-nullable</artifactId>
                <version>0.2.6</version>
            </dependency>
            <dependency>
                <groupId>org.camunda.community</groupId>
                <artifactId>camunda-engine-rest-client-openapi-springboot</artifactId>
                <version>${camunda-engine-rest-client-openapi-java.version}</version>
            </dependency>
            <dependency>
                <groupId>org.camunda.community</groupId>
                <artifactId>camunda-engine-rest-client-openapi-java</artifactId>
                <version>${camunda-engine-rest-client-openapi-java.version}</version>
            </dependency>
            <dependency>
                <groupId>org.camunda.bpm</groupId>
                <artifactId>camunda-external-task-client</artifactId>
                <version>${camunda.version.ce}</version>
            </dependency>
            <dependency>
                <groupId>org.camunda.bpm</groupId>
                <artifactId>camunda-external-task-client-spring</artifactId>
                <version>${camunda.version.ce}</version>
            </dependency>
            <dependency>
                <groupId>org.camunda.bpm.springboot</groupId>
                <artifactId>camunda-bpm-spring-boot-starter-external-task-client</artifactId>
                <version>${camunda.version.ce}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${org.mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                    <configuration>
                        <propertiesEncoding>UTF-8</propertiesEncoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.3.0</version>
                    <executions>
                        <execution>
                            <id>enforce-maven</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireJavaVersion>
                                        <version>11</version>
                                    </requireJavaVersion>
                                    <requireMavenVersion>
                                        <version>3.6.0</version>
                                    </requireMavenVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                    <configuration>
                        <forceJavacCompilerUse>true</forceJavacCompilerUse>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <!-- Version muss mit der durch Spring-Boot-Starter bereitgestellten Version übereinstimmen -->
                                <version>${lombok.version}</version>
                            </path>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok-mapstruct-binding</artifactId>
                                <version>${lombok.mapstruct.binding.version}</version>
                            </path>
                            <path>
                                <groupId>org.mapstruct</groupId>
                                <artifactId>mapstruct-processor</artifactId>
                                <version>${org.mapstruct.version}</version>
                            </path>
                            <!-- other annotation processors -->
                        </annotationProcessorPaths>
                        <compilerArgs>
                            <compilerArg>
                                -Amapstruct.defaultComponentModel=spring
                            </compilerArg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.13</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0</version>
                    <configuration>
                        <argLine>@{argLine} -Xms256m -Xmx2048m -Dfile.encoding=${project.build.sourceEncoding}</argLine>
                        <runOrder>random</runOrder>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.0.0</version>
                    <executions>
                        <execution>
                            <id>run-itests</id>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                        <argLine>@{argLine} -Xms256m -Xmx2048m -Dfile.encoding=${project.build.sourceEncoding}</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.9</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.1</version>
                </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>
                <plugin>
                    <groupId>org.openapitools</groupId>
                    <artifactId>openapi-generator-maven-plugin</artifactId>
                    <version>6.6.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.15.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>

            <!-- Nexus Staging Plugin -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>frontend</id>
            <modules>
                <module>digiwf-apps</module>
            </modules>
        </profile>
        <profile>
            <id>docs</id>
            <modules>
                <module>docs</module>
            </modules>
        </profile>

        <profile>
            <id>camunda-ee</id>
            <properties>
                <camunda.version>${camunda.version.ee}</camunda.version>
            </properties>
            <repositories>
                <repository>
                    <id>camunda-bpm-nexus-ee</id>
                    <name>camunda-bpm-nexus</name>
                    <url>https://camunda.jfrog.io/artifactory/private/</url>
                </repository>
            </repositories>
        </profile>


        <!-- Deployment profile (required so these plugins are only used when deploying) -->

        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <!-- maven versions plugin-->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                    </plugin>
                    <!-- Source plugin -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Javadoc plugin -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <doclint>none</doclint>
                            <sourceFileIncludes>
                                <sourceFileInclude>**/*.java</sourceFileInclude>
                            </sourceFileIncludes>
                        </configuration>
                    </plugin>

                    <!-- GPG plugin -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <!-- Central Repository -->
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <developers>
        <developer>
            <name>Alexander Boxhorn</name>
            <organization>Landeshauptstadt München</organization>
            <url>https://github.com/boal</url>
            <roles>
                <role>initiator</role>
            </roles>
        </developer>
        <developer>
            <name>axd4</name>
            <organization>Landeshauptstadt München</organization>
            <url>https://github.com/axd4</url>
            <roles>
                <role>initiator</role>
            </roles>
        </developer>
        <developer>
            <name>Dominik Horn</name>
            <organization>Miragon GmbH</organization>
            <url>https://github.com/dominikhorn93</url>
            <roles>
                <role>initiator</role>
            </roles>
        </developer>
        <developer>
            <name>martind260</name>
            <organization>Landeshauptstadt München</organization>
            <url>https://github.com/martind260</url>
            <roles>
                <role>initiator</role>
            </roles>
        </developer>
        <developer>
            <name>Lukas Mösle</name>
            <organization>Miragon GmbH</organization>
            <url>https://github.com/lmoesle</url>
            <roles>
                <role>initiator</role>
            </roles>
        </developer>
        <developer>
            <name>Simon Zambrovski</name>
            <email>simon.zambrovski@holisticon.de</email>
            <organization>Holisticon AG</organization>
            <organizationUrl>https://holisticon.de/</organizationUrl>
            <url>https://github.com/zambrovski</url>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT License</name>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/it-at-m/digiwf-core</url>
        <connection>scm:git:git@github.com:it-at-m/digiwf-core.git</connection>
        <developerConnection>scm:git:git@github.com:it-at-m/digiwf-core.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

</project>
