<?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>
  <parent>
    <groupId>org.camunda.community</groupId>
    <artifactId>community-hub-release-parent</artifactId>
    <version>2.1.0</version>
  </parent>
  <groupId>io.camunda</groupId>
  <artifactId>camunda-management-api-client-java-parent</artifactId>
  <name>Camunda Management API Client Java Parent</name>
  <version>2.1.0</version>
  <packaging>pom</packaging>
  <modules>
    <module>camunda-management-api-client-java-generated</module>
    <module>camunda-management-api-client-java-core</module>
  </modules>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <plugin.version.function-maven-plugin>1.0.0</plugin.version.function-maven-plugin>
    <plugin.version.maven-enforcer-plugin>3.6.2</plugin.version.maven-enforcer-plugin>
    <plugin.version.maven-install-plugin>3.1.4</plugin.version.maven-install-plugin>
    <plugin.version.maven-resources-plugin>3.3.1</plugin.version.maven-resources-plugin>
    <plugin.version.maven-shade-plugin>3.6.1</plugin.version.maven-shade-plugin>
    <plugin.version.maven-surefire-plugin>3.5.4</plugin.version.maven-surefire-plugin>
    <plugin.version.spotless-maven-plugin>3.0.0</plugin.version.spotless-maven-plugin>
    <plugin.version.maven-compiler-plugin>3.14.1</plugin.version.maven-compiler-plugin>
    <plugin.version.native-maven-plugin>0.11.3</plugin.version.native-maven-plugin>
    <plugin.version.maven-depdendency-plugin>3.9.0</plugin.version.maven-depdendency-plugin>
    <plugin.version.maven-site-plugin>3.21.0</plugin.version.maven-site-plugin>
    <plugin.version.maven-assembly-plugin>3.7.1</plugin.version.maven-assembly-plugin>
    <plugin.version.maven-release-plugin>3.2.0</plugin.version.maven-release-plugin>
    <plugin.version.frontend-maven-plugin>1.15.4</plugin.version.frontend-maven-plugin>
    <plugin.version.maven-source-plugin>3.3.1</plugin.version.maven-source-plugin>
    <plugin.version.openapi-generator-maven-plugin>7.17.0</plugin.version.openapi-generator-maven-plugin>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>3.5.7</version>
        <type>pom</type>
        <scope>import</scope>
      </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.8</version>
      </dependency>
      <dependency>
        <groupId>org.wiremock</groupId>
        <artifactId>wiremock-standalone</artifactId>
        <version>3.13.1</version>
      </dependency>
      <dependency>
        <groupId>org.junit-pioneer</groupId>
        <artifactId>junit-pioneer</artifactId>
        <version>2.3.0</version>
      </dependency>
      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>camunda-management-api-client-java-generated</artifactId>
        <version>${project.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.openapitools</groupId>
          <artifactId>openapi-generator-maven-plugin</artifactId>
          <version>${plugin.version.openapi-generator-maven-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.7.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${plugin.version.maven-source-plugin}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${plugin.version.maven-assembly-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${plugin.version.maven-resources-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${plugin.version.maven-site-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${plugin.version.maven-depdendency-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.graalvm.buildtools</groupId>
          <artifactId>native-maven-plugin</artifactId>
          <version>${plugin.version.native-maven-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${plugin.version.maven-compiler-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${version.spring-boot}</version>
          <configuration>
            <image>
              <env>
                <BP_JVM_VERSION>17</BP_JVM_VERSION>
                <BPE_LANG>en_US.utf8</BPE_LANG>
              </env>
              <createdDate>${maven.build.timestamp}</createdDate>
            </image>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${plugin.version.maven-install-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${plugin.version.maven-shade-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${plugin.version.maven-surefire-plugin}</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${plugin.version.maven-enforcer-plugin}</version>
          <configuration>
            <rules>
              <!--
                <dependencyConvergence />
              -->
              <requirePluginVersions />
            </rules>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>enforce</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${plugin.version.spotless-maven-plugin}</version>
          <configuration>
            <formats>
              <format>
                <includes>
                  <include>*.md</include>
                  <include>.gitignore</include>
                </includes>
                <trimTrailingWhitespace />
                <endWithNewline />
                <indent>
                  <spaces>true</spaces>
                  <spacesPerTab>2</spacesPerTab>
                </indent>
              </format>
            </formats>
            <java>
              <googleJavaFormat />
              <removeUnusedImports />
            </java>
            <pom />
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.google.cloud.functions</groupId>
          <artifactId>function-maven-plugin</artifactId>
          <version>${plugin.version.function-maven-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${plugin.version.maven-release-plugin}</version>
        </plugin>
        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>${plugin.version.frontend-maven-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <versionRange>[1.0.0,)</versionRange>
                    <goals>
                      <goal>enforce</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- profile to auto format -->
    <profile>
      <id>autoFormat</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.diffplug.spotless</groupId>
            <artifactId>spotless-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>spotless-format</id>
                <goals>
                  <goal>apply</goal>
                </goals>
                <phase>process-sources</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- profile to perform strict validation checks -->
    <profile>
      <id>checkFormat</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.diffplug.spotless</groupId>
            <artifactId>spotless-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>spotless-check</id>
                <goals>
                  <goal>check</goal>
                </goals>
                <phase>validate</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>