<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © 2015 - 2025 ReSys (info@dialob.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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 https://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>io.dialob</groupId>
    <artifactId>dialob-parent</artifactId>
    <version>2.3.1</version>
  </parent>

  <artifactId>dialob-build-parent</artifactId>
  <name>dialob-build-parent</name>
  <packaging>pom</packaging>

  <properties>
    <java.version>21</java.version>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.encoding>${project.build.sourceEncoding}</maven.compiler.encoding>
    <maven.resources.encoding>${project.build.sourceEncoding}</maven.resources.encoding>
    <maven.javadoc.failOnError>false</maven.javadoc.failOnError>

    <!-- Skip DB2 integration tests by default (Really slow!) -->
    <excludedGroups>db2</excludedGroups>

    <!-- plugin dependencies -->
    <git-commit-id-maven-plugin.version>9.0.2</git-commit-id-maven-plugin.version>
    <maven-pmd-plugin.version>3.28.0</maven-pmd-plugin.version>
    <spotbugs-maven-plugin.version>4.9.8.1</spotbugs-maven-plugin.version>
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
    <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
    <maven-release-plugin.version>3.2.0</maven-release-plugin.version>
    <maven-site-plugin.version>3.21.0</maven-site-plugin.version>
    <jib-maven-plugin.version>3.4.6</jib-maven-plugin.version>
    <cyclonedx-maven-plugin.version>2.9.1</cyclonedx-maven-plugin.version>

    <thirdparty.log.level>INFO</thirdparty.log.level>

    <!-- runtime dependencies -->
    <spring-boot.version>3.5.7</spring-boot.version>

    <antlr4.version>4.13.2</antlr4.version>
    <aws-java-sdk.version>2.38.3</aws-java-sdk.version>
    <azure-sdk.version>1.3.2</azure-sdk.version>
    <bcpkix-jdk18on.version>1.82</bcpkix-jdk18on.version>
    <checkerframework.version>3.52.0</checkerframework.version>
    <commons-compress.version>1.28.0</commons-compress.version>
    <commons-csv.version>1.14.1</commons-csv.version>
    <commons-lang3.version>3.18.0</commons-lang3.version>
    <commons-text.version>1.14.0</commons-text.version>
    <commons-validator.version>1.10.0</commons-validator.version>
    <db2jcc.version>11.5.8.0</db2jcc.version>
    <db2jcc4.version>4.23.42</db2jcc4.version>
    <guava.version>33.5.0-jre</guava.version>
    <hamcrest.version>3.0</hamcrest.version>
    <immutables.version>2.11.6</immutables.version>
    <jetbrains-annotations.version>26.0.2-1</jetbrains-annotations.version>
    <jsoup.version>1.21.2</jsoup.version>
    <lombok.version>1.18.42</lombok.version>
    <protobuf-java.version>4.33.0</protobuf-java.version>
    <s3mock-junit5.version>4.10.0</s3mock-junit5.version>
    <spotbugs-annotations.version>4.9.8</spotbugs-annotations.version>
    <spring-cloud-gcp.version>7.4.1</spring-cloud-gcp.version>
    <springdoc.version>2.8.14</springdoc.version>
    <swagger.version>2.2.40</swagger.version>
    <tomcat-embed-el.version>11.0.14</tomcat-embed-el.version>

    <!-- test dependencies -->
    <assertj-core.version>3.27.6</assertj-core.version>
    <junit.version>6.0.1</junit.version>
    <mockito.version>5.20.0</mockito.version>
    <testcontainers.version>2.0.1</testcontainers.version>
    <testcontainers-redis.version>2.2.4</testcontainers-redis.version>
    <equalsverifier.version>4.2.2</equalsverifier.version>

    <!-- docker image -->
    <image.base.name>amazoncorretto:${java.version}</image.base.name>
  </properties>


  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-annotations</artifactId>
      <version>${spotbugs-annotations.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- annotation processors -->
    <dependency>
      <groupId>org.immutables</groupId>
      <artifactId>value</artifactId>
      <version>${immutables.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-autoconfigure-processor</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-configuration-processor</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-commons</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hibernate.validator</groupId>
      <artifactId>hibernate-validator</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven-javadoc-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>${maven-pmd-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>${spotbugs-maven-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven-checkstyle-plugin.version}</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>checkstyle</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.dialob</groupId>
        <artifactId>dialob-bom</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>bom</artifactId>
        <version>${aws-java-sdk.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.azure</groupId>
        <artifactId>azure-sdk-bom</artifactId>
        <version>${azure-sdk.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>



      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-text</artifactId>
        <version>${commons-text.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-csv</artifactId>
        <version>${commons-csv.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-validator</groupId>
        <artifactId>commons-validator</artifactId>
        <version>${commons-validator.version}</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4</artifactId>
        <version>${antlr4.version}</version>
      </dependency>
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>${antlr4.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jsoup</groupId>
        <artifactId>jsoup</artifactId>
        <version>${jsoup.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>


      <dependency>
        <groupId>io.swagger.core.v3</groupId>
        <artifactId>swagger-models</artifactId>
        <version>${swagger.version}</version>
      </dependency>
      <dependency>
        <groupId>io.swagger.core.v3</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>${swagger.version}</version>
      </dependency>

      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>spring-cloud-gcp-starter-pubsub</artifactId>
        <version>${spring-cloud-gcp.version}</version>
      </dependency>

      <!-- force version compatible with google datastore -->
      <dependency>
        <groupId>com.ibm.db2.jcc</groupId>
        <artifactId>db2jcc4</artifactId>
        <version>${db2jcc4.version}</version>
      </dependency>
      <dependency>
        <groupId>com.ibm.db2</groupId>
        <artifactId>jcc</artifactId>
        <version>${db2jcc.version}</version>
      </dependency>
      <dependency>
        <groupId>org.immutables</groupId>
        <artifactId>gson</artifactId>
        <version>${immutables.version}</version>
      </dependency>
      <dependency>
        <groupId>org.immutables</groupId>
        <artifactId>mongo</artifactId>
        <version>${immutables.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${commons-compress.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf-java.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains</groupId>
        <artifactId>annotations</artifactId>
        <version>${jetbrains-annotations.version}</version>
      </dependency>
      <dependency>
        <groupId>com.adobe.testing</groupId>
        <artifactId>s3mock-junit5</artifactId>
        <version>${s3mock-junit5.version}</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk18on</artifactId>
        <version>${bcpkix-jdk18on.version}</version>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-bom</artifactId>
        <version>${springdoc.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-bom</artifactId>
        <version>${mockito.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.redis</groupId>
        <artifactId>testcontainers-redis</artifactId>
        <version>${testcontainers-redis.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-el</artifactId>
        <version>${tomcat-embed-el.version}</version>
      </dependency>
      <dependency>
        <groupId>org.checkerframework</groupId>
        <artifactId>checker-qual</artifactId>
        <version>${checkerframework.version}</version>
      </dependency>
      <dependency>
        <groupId>nl.jqno.equalsverifier</groupId>
        <artifactId>equalsverifier</artifactId>
        <version>${equalsverifier.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>properties</goal>
            </goals>
          </execution>
        </executions>
      </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>

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>${maven-site-plugin.version}</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.google.cloud.tools</groupId>
          <artifactId>jib-maven-plugin</artifactId>
          <version>${jib-maven-plugin.version}</version>
          <configuration>
            <containerizingMode>packaged</containerizingMode>
            <from>
              <image>${base.image}</image>
              <platforms>
                <platform>
                  <architecture>amd64</architecture>
                  <os>linux</os>
                </platform>
                <platform>
                  <architecture>arm64</architecture>
                  <os>linux</os>
                </platform>
              </platforms>
            </from>
            <to>
              <image>${jib.to.imagePath}/${project.artifactId}</image>
              <tags>
                <tag>latest</tag>
                <tag>${project.version}</tag>
                <tag>${branchName}</tag>
              </tags>
            </to>
            <container>
              <labels>
                <org.opencontainers.image.source>ssh@github.com:${env.GITHUB_REPOSITORY}</org.opencontainers.image.source>
                <org.opencontainers.image.revision>${env.GITHUB_SHA}</org.opencontainers.image.revision>
                <org.opencontainers.image.version>${env.GITHUB_REF_NAME}</org.opencontainers.image.version>
                <org.opencontainers.image.created>${maven.build.timestamp}</org.opencontainers.image.created>
                <org.opencontainers.image.base.name>${image.base.name}</org.opencontainers.image.base.name>
                <com.github.actions.event.name>${env.GITHUB_EVENT_NAME}</com.github.actions.event.name>
                <com.github.actions.run.url>https://github.com/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}</com.github.actions.run.url>
              </labels>
              <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
            </container>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.cyclonedx</groupId>
          <artifactId>cyclonedx-maven-plugin</artifactId>
          <version>${cyclonedx-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.14.0</version>
          <configuration>
            <annotationProcessorPaths>
              <path>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
              </path>
              <path>
                <groupId>org.immutables</groupId>
                <artifactId>value</artifactId>
                <version>${immutables.version}</version>
              </path>
              <path>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-autoconfigure-processor</artifactId>
              </path>
              <path>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-configuration-processor</artifactId>
              </path>
            </annotationProcessorPaths>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.4</version>
          <configuration>
            <argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.7.1</version>
        </plugin>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring-boot.version}</version>
        </plugin>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>5.2.0.4988</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.4.2</version>
        </plugin>
        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr4-maven-plugin</artifactId>
          <version>${antlr4.version}</version>
        </plugin>
        <plugin>
          <groupId>io.github.git-commit-id</groupId>
          <artifactId>git-commit-id-maven-plugin</artifactId>
          <version>${git-commit-id-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <id>local-dev</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>com.google.cloud.tools</groupId>
              <artifactId>jib-maven-plugin</artifactId>
              <executions>
                <execution>
                  <id>docker-build</id>
                  <phase>install</phase>
                  <goals>
                    <goal>dockerBuild</goal>
                  </goals>
                  <configuration>
                    <to>
                      <image>${project.artifactId}</image>
                    </to>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
