<?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>1.4.4</version>
    <relativePath />
  </parent>

  <groupId>org.camunda.bpm.extension</groupId>
  <artifactId>camunda-bpm-mail-root</artifactId>
  <version>7.18.2</version>
  <packaging>pom</packaging>
  <name>Camunda Automation Platform Mail</name>

  <properties>
    <version.java>1.8</version.java>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <encoding>UTF-8</encoding>
    <project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
    <project.build.resourceEncoding>${encoding}</project.build.resourceEncoding>
    <!-- versions -->
    <version.camunda>7.18.0</version.camunda>
    <version.springBoot>2.7.18</version.springBoot>
    <!-- tests -->
    <version.greenmail>1.6.15</version.greenmail>
    <!-- maven plugins (not managed by parent) -->
    <plugin.version.function-maven-plugin>0.11.0</plugin.version.function-maven-plugin>
    <plugin.version.maven-enforcer-plugin>3.4.1</plugin.version.maven-enforcer-plugin>
    <plugin.version.maven-install-plugin>3.1.1</plugin.version.maven-install-plugin>
    <plugin.version.maven-resources-plugin>3.3.1</plugin.version.maven-resources-plugin>
    <plugin.version.maven-shade-plugin>3.5.1</plugin.version.maven-shade-plugin>
    <plugin.version.maven-surefire-plugin>3.2.5</plugin.version.maven-surefire-plugin>
    <plugin.version.spotless-maven-plugin>2.42.0</plugin.version.spotless-maven-plugin>
    <plugin.version.maven-war-plugin>3.4.0</plugin.version.maven-war-plugin>
    <plugin.version.maven-site-plugin>3.12.1</plugin.version.maven-site-plugin>
    <plugin.version.transformer-maven-plugin>0.5.0</plugin.version.transformer-maven-plugin>
    <plugin.version.maven-dependency-plugin>3.6.1</plugin.version.maven-dependency-plugin>
  </properties>

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

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

  <modules>
    <module>extension</module>
    <module>examples</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>${version.camunda}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${version.springBoot}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <!-- modules -->
      <dependency>
        <groupId>org.camunda.bpm.extension</groupId>
        <artifactId>camunda-bpm-mail-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.camunda.bpm.extension</groupId>
        <artifactId>camunda-bpm-mail-spring-boot-starter</artifactId>
        <version>${project.version}</version>
      </dependency>
      <!-- test -->
      <dependency>
        <groupId>com.icegreen</groupId>
        <artifactId>greenmail-junit4</artifactId>
        <version>${version.greenmail}</version>
      </dependency>
      <dependency>
        <groupId>com.icegreen</groupId>
        <artifactId>greenmail-junit5</artifactId>
        <version>${version.greenmail}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${plugin.version.maven-dependency-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.transformer</groupId>
          <artifactId>transformer-maven-plugin</artifactId>
          <version>${plugin.version.transformer-maven-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.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${version.springBoot}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>${plugin.version.maven-war-plugin}</version>
        </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 />
            </java>
            <pom />
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.google.cloud.functions</groupId>
          <artifactId>function-maven-plugin</artifactId>
          <version>${plugin.version.function-maven-plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </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>
