<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>org.camunda.community.migration</groupId>
  <artifactId>camunda-7-to-8-migration</artifactId>
  <name>Camunda 7 to 8 Migration</name>
  <version>0.12.0</version>
  <packaging>pom</packaging>

  <parent>
    <groupId>org.camunda.community</groupId>
    <artifactId>community-hub-release-parent</artifactId>
    <version>2.1.0</version>
  </parent>

  <properties>
    <encoding>UTF-8</encoding>
    <project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
    <project.build.resourceEncoding>${encoding}</project.build.resourceEncoding>
    <version.java>17</version.java>
    <maven.compiler.source>${version.java}</maven.compiler.source>
    <maven.compiler.target>${version.java}</maven.compiler.target>

    <version.zeebe>8.8.0</version.zeebe>
    <version.camunda.platform>7.23.0</version.camunda.platform>
    <version.spring-boot>3.5.6</version.spring-boot>

    <version.protobuf>4.32.1</version.protobuf>
    <version.guava>33.5.0-jre</version.guava>
    <version.error_prone_annotations>2.42.0</version.error_prone_annotations>

    <version.archunit>1.4.1</version.archunit>

    <plugin.version.maven-enforcer-plugin>3.6.2</plugin.version.maven-enforcer-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.maven-site-plugin>3.21.0</plugin.version.maven-site-plugin>
    <plugin.version.maven-source-plugin>3.3.1</plugin.version.maven-source-plugin>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>${version.camunda.platform}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>zeebe-bom</artifactId>
        <version>${version.zeebe}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${version.spring-boot}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-bom</artifactId>
        <version>${version.protobuf}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava-bom</artifactId>
        <version>${version.guava}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.google.errorprone</groupId>
        <artifactId>error_prone_annotations</artifactId>
        <version>${version.error_prone_annotations}</version>
      </dependency>

      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>spring-boot-starter-camunda-sdk</artifactId>
        <version>${version.zeebe}</version>
      </dependency>
      <dependency>
        <groupId>io.camunda</groupId>
        <artifactId>camunda-process-test-spring</artifactId>
        <version>${version.zeebe}</version>
      </dependency>
      <dependency>
        <groupId>com.tngtech.archunit</groupId>
        <artifactId>archunit-junit5</artifactId>
        <version>${version.archunit}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <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-site-plugin</artifactId>
          <version>${plugin.version.maven-site-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${plugin.version.maven-compiler-plugin}</version>
          <configuration>
            <compilerArgs>
              <arg>-parameters</arg>
            </compilerArgs>
          </configuration>
        </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-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>
              <reactorModuleConvergence />
              <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 />
            </java>
            <pom />
          </configuration>
        </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>
      <id>example</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>example</module>
      </modules>
    </profile>

    <!-- 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>
  <modules>
    <module>camunda-7-adapter</module>
    <module>test-example-diagrams</module>
    <module>code-migration-detector</module>
  </modules>

</project>
