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

     Copyright 2017-2026 Adobe.

     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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.adobe.testing</groupId>
  <artifactId>s3mock-parent</artifactId>
  <version>5.2.0</version>
  <packaging>pom</packaging>

  <name>S3Mock - Parent</name>
  <description>S3 mock implementation to be used for hermetic testing</description>
  <url>https://www.github.com/adobe/S3Mock</url>

  <!-- required metadata for publishing the Maven artifacts -->
  <organization>
    <name>Adobe</name>
    <url>https://www.adobe.com</url>
  </organization>

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

  <developers>
    <developer>
      <name>Arne Franken</name>
      <email>franken@adobe.com</email>
      <organization>Adobe</organization>
      <organizationUrl>https://www.adobe.com</organizationUrl>
    </developer>
  </developers>

  <modules>
    <module>integration-tests</module>
    <module>server</module>
    <module>testsupport</module>
  </modules>

  <scm>
    <connection>scm:git:https://github.com/adobe/S3Mock.git</connection>
    <developerConnection>scm:git:https://github.com/adobe/S3Mock.git</developerConnection>
    <tag>5.2.0</tag>
    <url>https://github.com/adobe/S3Mock/tree/main</url>
  </scm>

  <properties>

    <archunit.version>1.5.0</archunit.version>

    <aws-kotlin.version>1.8.32</aws-kotlin.version>

    <aws-v2.version>2.53.2</aws-v2.version>

    <build-helper-maven-plugin.version>3.6.1</build-helper-maven-plugin.version>
    <central-publishing-maven-plugin.version>0.11.0</central-publishing-maven-plugin.version>
    <checkstyle.version>14.0.0</checkstyle.version>

    <docker.image.name>adobe/s3mock</docker.image.name>
    <dokka-maven-plugin.version>2.2.0</dokka-maven-plugin.version>
    <exec-maven-plugin.version>3.6.3</exec-maven-plugin.version>

    <java.target.version>17</java.target.version>
    <java.version>25</java.version>
    <jazzer.version>0.30.0</jazzer.version>
    <jetbrains-annotations.version>26.1.0</jetbrains-annotations.version>
    <kotlin-coroutines.version>1.11.0</kotlin-coroutines.version>
    <kotlin.compiler.apiVersion>2.2</kotlin.compiler.apiVersion>
    <kotlin.compiler.jvmTarget>${java.target.version}</kotlin.compiler.jvmTarget>
    <kotlin.compiler.languageVersion>2.2</kotlin.compiler.languageVersion>
    <kotlin.version>2.4.10</kotlin.version>
    <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
    <maven-clean-plugin.version>3.5.0</maven-clean-plugin.version>
    <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
    <maven-dependency-plugin.version>3.11.0</maven-dependency-plugin.version>
    <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
    <maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version>
    <maven-failsafe-plugin.version>3.5.6</maven-failsafe-plugin.version>
    <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
    <maven-install-plugin.version>3.1.4</maven-install-plugin.version>
    <maven-jar-plugin.version>3.5.1</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
    <maven-release-plugin.version>3.3.1</maven-release-plugin.version>
    <maven-resources-plugin.version>3.5.0</maven-resources-plugin.version>
    <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
    <mockito-kotlin.version>6.3.0</mockito-kotlin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <!-- Run Docker build by default -->
    <skipDocker>false</skipDocker>
    <spotless-maven-plugin.version>3.10.0</spotless-maven-plugin.version>
    <spring-boot.version>4.1.1</spring-boot.version>
    <spring-test-profiler.version>0.3.0</spring-test-profiler.version>
    <testcontainers.version>2.0.5</testcontainers.version>
    <testng.version>7.12.0</testng.version>
    <xmlunit-assertj3.version>2.13.0</xmlunit-assertj3.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-bom</artifactId>
        <version>${kotlin.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlinx</groupId>
        <artifactId>kotlinx-coroutines-bom</artifactId>
        <version>${kotlin-coroutines.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>bom</artifactId>
        <version>${aws-v2.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>aws.sdk.kotlin</groupId>
        <artifactId>s3-jvm</artifactId>
        <version>${aws-kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>com.adobe.testing</groupId>
        <artifactId>s3mock</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.adobe.testing</groupId>
        <artifactId>s3mock</artifactId>
        <version>${project.version}</version>
        <classifier>exec</classifier>
      </dependency>
      <dependency>
        <groupId>com.adobe.testing</groupId>
        <artifactId>s3mock-testcontainers</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.adobe.testing</groupId>
        <artifactId>s3mock-testsupport-common</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.code-intelligence</groupId>
        <artifactId>jazzer-junit</artifactId>
        <version>${jazzer.version}</version>
      </dependency>
      <dependency>
        <!-- Workaround: set version here to force dependencies to converge. -->
        <groupId>org.jetbrains</groupId>
        <artifactId>annotations</artifactId>
        <version>${jetbrains-annotations.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito.kotlin</groupId>
        <artifactId>mockito-kotlin</artifactId>
        <version>${mockito-kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
      </dependency>
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
      </dependency>
      <dependency>
        <groupId>org.xmlunit</groupId>
        <artifactId>xmlunit-assertj3</artifactId>
        <version>${xmlunit-assertj3.version}</version>
      </dependency>
      <dependency>
        <groupId>com.tngtech.archunit</groupId>
        <artifactId>archunit-junit5</artifactId>
        <version>${archunit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>digital.pragmatech.testing</groupId>
        <artifactId>spring-test-profiler</artifactId>
        <version>${spring-test-profiler.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless-maven-plugin.version}</version>
          <configuration>
            <!-- Only enforce/reformat files that changed since main - keeps license-header
                 year bumps scoped to files actually touched (see INVARIANTS.md). -->
            <ratchetFrom>origin/main</ratchetFrom>
            <kotlin>
              <ktlint />
              <licenseHeader>
                <file>${maven.multiModuleProjectDirectory}/etc/license-header-spotless.txt</file>
              </licenseHeader>
            </kotlin>
            <java>
              <licenseHeader>
                <file>${maven.multiModuleProjectDirectory}/etc/license-header-spotless.txt</file>
              </licenseHeader>
            </java>
            <pom>
              <sortPom>
                <encoding>${project.build.sourceEncoding}</encoding>
                <keepBlankLines>true</keepBlankLines>
                <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
                <sortDependencies>scope,groupId,artifactId</sortDependencies>
                <sortModules>true</sortModules>
                <sortPlugins>scope,groupId,artifactId</sortPlugins>
                <sortProperties>true</sortProperties>
              </sortPom>
              <licenseHeader>
                <file>${maven.multiModuleProjectDirectory}/etc/license-header-spotless-xml.txt</file>
                <delimiter>&lt;project</delimiter>
                <skipLinesMatching>^&lt;\?xml.*\?&gt;$</skipLinesMatching>
              </licenseHeader>
            </pom>
            <formats>
              <format>
                <includes>
                  <include>Makefile</include>
                </includes>
                <licenseHeader>
                  <file>${maven.multiModuleProjectDirectory}/etc/license-header-spotless-hash.txt</file>
                  <delimiter>^# Agents:</delimiter>
                </licenseHeader>
              </format>
              <format>
                <includes>
                  <include>src/main/resources/**/*.properties</include>
                  <include>src/test/resources/**/*.properties</include>
                  <include>src/test/resources/**/*.factories</include>
                </includes>
                <licenseHeader>
                  <file>${maven.multiModuleProjectDirectory}/etc/license-header-spotless-hash.txt</file>
                  <delimiter>^[^#]</delimiter>
                </licenseHeader>
              </format>
              <format>
                <includes>
                  <include>src/test/resources/logback.xml</include>
                  <include>src/test/resources/com/**/*.xml</include>
                </includes>
                <licenseHeader>
                  <file>${maven.multiModuleProjectDirectory}/etc/license-header-spotless-xml.txt</file>
                  <delimiter>^&lt;[A-Za-z]</delimiter>
                  <skipLinesMatching>^&lt;\?xml.*\?&gt;$</skipLinesMatching>
                </licenseHeader>
              </format>
              <format>
                <includes>
                  <include>etc/checkstyle.xml</include>
                  <include>src/test/resources/testng.xml</include>
                </includes>
                <licenseHeader>
                  <file>${maven.multiModuleProjectDirectory}/etc/license-header-spotless-xml.txt</file>
                  <delimiter>^&lt;!DOCTYPE</delimiter>
                  <skipLinesMatching>^&lt;\?xml.*\?&gt;$</skipLinesMatching>
                </licenseHeader>
              </format>
            </formats>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven-checkstyle-plugin.version}</version>
          <configuration>
            <consoleOutput>false</consoleOutput>
            <failOnViolation>true</failOnViolation>
            <violationSeverity>info</violationSeverity>
            <includeTestSourceDirectory>true</includeTestSourceDirectory>
            <configLocation>etc/checkstyle.xml</configLocation>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${checkstyle.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>check-style</id>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>validate</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven-clean-plugin.version}</version>
        </plugin>
        <plugin>
          <!--
          Config from https://kotlinlang.org/docs/maven.html#compile-kotlin-and-java-sources
          -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <release>${java.target.version}</release>
            <encoding>${project.build.sourceEncoding}</encoding>
            <parameters>true</parameters>
          </configuration>
          <executions>
            <!-- Replacing default-compile as it is treated specially by maven -->
            <execution>
              <id>default-compile</id>
              <phase>none</phase>
            </execution>
            <!-- Replacing default-testCompile as it is treated specially by maven -->
            <execution>
              <id>default-testCompile</id>
              <phase>none</phase>
            </execution>
            <execution>
              <id>java-compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
              <phase>compile</phase>
            </execution>
            <execution>
              <id>java-test-compile</id>
              <goals>
                <goal>testCompile</goal>
              </goals>
              <phase>test-compile</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven-dependency-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${maven-enforcer-plugin.version}</version>
          <configuration>
            <rules>
              <requireMavenVersion>
                <version>[3.9,)</version>
              </requireMavenVersion>
              <requireJavaVersion>
                <version>${java.version}</version>
              </requireJavaVersion>
              <dependencyConvergence />
              <requireUpperBoundDeps />
            </rules>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-failsafe-plugin.version}</version>
          <configuration>
            <failIfNoTests>true</failIfNoTests>
            <runOrder>random</runOrder>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
          <configuration>
            <gpgArguments>
              <arg>--pinentry-mode</arg>
              <arg>loopback</arg>
            </gpgArguments>
          </configuration>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <goals>
                <goal>sign</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven-install-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <configuration>
            <quiet>true</quiet>
            <failOnError>false</failOnError>
            <!-- Use java.target.version (17) so javadoc matches emitted bytecode; JDK 25 is the build toolchain (enforcer). -->
            <source>${java.target.version}</source>
            <detectJavaApiLink>false</detectJavaApiLink>
            <encoding>${project.build.sourceEncoding}</encoding>
            <docencoding>${project.reporting.outputEncoding}</docencoding>
            <charset>${project.reporting.outputEncoding}</charset>
          </configuration>
          <executions>
            <execution>
              <id>javadoc</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <phase>package</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <goals>deploy -DskipTests -Prelease -P!build-docker-image -Ppush-docker-image</goals>
            <!-- Skip Spotless during the release. The source already passed spotless:check in
                 CI and every PRB. The maven-release-plugin rewrites every pom to set the
                 release/next-dev version, and its JDOM writer normalizes empty elements to
                 `<foo />` (with a space), which Spotless sortPom would then reject (`<foo/>`) -
                 a violation the plugin introduces itself, not present in the committed source.
                 `arguments` is passed to both the prepare (preparationGoals) and perform
                 (goals) forked Maven builds. -->
            <arguments>-Dspotless.check.skip=true</arguments>
            <preparationGoals>clean install</preparationGoals>
            <tagNameFormat>@{project.version}</tagNameFormat>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
          <executions>
            <execution>
              <id>sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
              <phase>package</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
          <configuration>
            <failIfNoTests>true</failIfNoTests>
            <runOrder>random</runOrder>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build-helper-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>${exec-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.jetbrains.dokka</groupId>
          <artifactId>dokka-maven-plugin</artifactId>
          <version>${dokka-maven-plugin.version}</version>
          <configuration>
            <sourceDirectories>
              <dir>${project.basedir}/src/main/kotlin</dir>
            </sourceDirectories>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>javadocJar</goal>
              </goals>
              <phase>prepare-package</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <!--
          Config from https://kotlinlang.org/docs/maven.html#compile-kotlin-and-java-sources
          -->
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>kotlin-maven-plugin</artifactId>
          <version>${kotlin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <javaParameters>true</javaParameters>
            <args>
              <arg>-Xjsr305=strict</arg>
              <!-- Enable strict mode for JSR-305 annotations -->
            </args>
            <compilerPlugins>
              <plugin>spring</plugin>
            </compilerPlugins>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.jetbrains.kotlin</groupId>
              <artifactId>kotlin-maven-allopen</artifactId>
              <version>${kotlin.version}</version>
            </dependency>
            <dependency>
              <groupId>org.jetbrains.kotlin</groupId>
              <artifactId>kotlin-maven-noarg</artifactId>
              <version>${kotlin.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                </sourceDirs>
              </configuration>
            </execution>
            <execution>
              <id>test-compile</id>
              <goals>
                <goal>test-compile</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                </sourceDirs>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>${central-publishing-maven-plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <autoPublish>true</autoPublish>
            <publishingServerId>central</publishingServerId>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring-boot.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-maven-and-jdk</id>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
      </plugin>
    </plugins>
    <sourceDirectory>src/main/kotlin</sourceDirectory>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <!--
            Dokka generates the KDoc/Javadoc jar required for publishing. It is release-only because
            it is only needed for deployment and its plugin loader logs hundreds of lines per module,
            which would otherwise flood every local and CI build.
          -->
          <plugin>
            <groupId>org.jetbrains.dokka</groupId>
            <artifactId>dokka-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.15</version>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <formats>
                    <format>XML</format>
                  </formats>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
