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

     Copyright 2017-2022 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>2.4.16-SNAPSHOT</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>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

 

  <modules>
    <module>build-config</module>
    <module>server</module>
  </modules>

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

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <aws-v2.version>2.17.243</aws-v2.version>

    <aws.version>1.12.271</aws.version>
    <checkstyle.version>10.3.1</checkstyle.version>
    <commons-codec.version>1.15</commons-codec.version>
    <commons-io.version>2.11.0</commons-io.version>
    <docker-builder.image.name>s3mock-buildx</docker-builder.image.name>
    <docker-maven-plugin.version>0.40.2</docker-maven-plugin.version>

    <docker.image.name>adobe/s3mock</docker.image.name>
    <java.version>8</java.version>
    <junit-jupiter.version>5.7.2</junit-jupiter.version>
    <junit.version>4.13.2</junit.version>
    <kotlin.version>1.7.10</kotlin.version>
    <license-maven-plugin-git.version>4.1</license-maven-plugin-git.version>
    <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
    <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
    <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
    <maven-deploy-plugin.version>3.0.0</maven-deploy-plugin.version>
    <maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
    <maven-failsafe-plugin.version>3.0.0-M7</maven-failsafe-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    <maven-install-plugin.version>3.0.1</maven-install-plugin.version>
    <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
    <maven-release-plugin.version>3.0.0-M6</maven-release-plugin.version>
    <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
    <mockito-kotlin.version>4.0.0</mockito-kotlin.version>
    <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- Run Docker build by default -->
    <skipDocker>false</skipDocker>
    <sortpom-maven-plugin.version>3.2.0</sortpom-maven-plugin.version>
    <spring-boot.version>2.7.2</spring-boot.version>
    <spring-security-oauth2.version>2.5.2.RELEASE</spring-security-oauth2.version>
    <testcontainers.version>1.17.3</testcontainers.version>
    <testng.version>7.6.1</testng.version>
    <xmlunit-assertj3.version>2.9.0</xmlunit-assertj3.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <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-docker</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>com.adobe.testing</groupId>
        <artifactId>s3mock-testsupport-common</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-s3</artifactId>
        <version>${aws.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io.version}</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib-jdk8</artifactId>
        <version>${kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-test</artifactId>
        <version>${kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-test-junit</artifactId>
        <version>${kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito.kotlin</groupId>
        <artifactId>mockito-kotlin</artifactId>
        <version>${mockito-kotlin.version}</version>
      </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>
      <!--
          S3 Mock doesn't need spring-security-oauth2. We ran into trouble
          when dependency was on classpath where server did not accept any
          requests (see https://github.com/adobe/S3Mock/issues/59).
          spring-security-oauth2 is referenced by s3mock-junit4, S3MockRuleTest needs
          to turn green.
      -->
      <dependency>
        <groupId>org.springframework.security.oauth</groupId>
        <artifactId>spring-security-oauth2</artifactId>
        <version>${spring-security-oauth2.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${testcontainers.version}</version>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers</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>software.amazon.awssdk</groupId>
        <artifactId>aws-query-protocol</artifactId>
        <version>${aws-v2.version}</version>
      </dependency>
      <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>aws-xml-protocol</artifactId>
        <version>${aws-v2.version}</version>
      </dependency>
      <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>s3</artifactId>
        <version>${aws-v2.version}</version>
      </dependency>
      <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>url-connection-client</artifactId>
        <version>${aws-v2.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.github.ekryd.sortpom</groupId>
          <artifactId>sortpom-maven-plugin</artifactId>
          <version>${sortpom-maven-plugin.version}</version>
          <configuration>
            <encoding>${project.build.sourceEncoding}</encoding>
            <keepBlankLines>true</keepBlankLines>
            <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
            <sortDependencies>groupId,artifactId,scope</sortDependencies>
            <sortModules>true</sortModules>
            <sortPlugins>groupId,artifactId,scope</sortPlugins>
            <sortProperties>true</sortProperties>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>sort</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license-maven-plugin-git.version}</version>
          <configuration>
            <header>etc/license-template.txt</header>
            <strictCheck>true</strictCheck>
            <excludes>
              <exclude>.idea/**</exclude>
              <exclude>.springBeans</exclude>
              <exclude>.editorconfig</exclude>
              <exclude>**/*.jks</exclude>
              <exclude>**/sample*.txt</exclude>
              <exclude>COPYRIGHT</exclude>
              <exclude>LICENSE</exclude>
              <exclude>AUTHORS</exclude>
              <exclude>README.md</exclude>
              <exclude>.github/workflows/**</exclude>
              <exclude>CONTRIBUTING.md</exclude>
              <exclude>.gitattributes</exclude>
              <exclude>.gitignore</exclude>
              <exclude>src/main/resources/banner.txt</exclude>
            </excludes>
            <mapping>
              <java>SLASHSTAR_STYLE</java>
            </mapping>
            <properties>
              <project.inceptionYear>2017</project.inceptionYear>
            </properties>
            <!-- Do not execute when skipping tests.
              This also disables execution during a release. -->
            <skip>${skipTests}</skip>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.mycila</groupId>
              <artifactId>license-maven-plugin-git</artifactId>
              <!-- make sure you use the same version as license-maven-plugin -->
              <version>${license-maven-plugin-git.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>${docker-maven-plugin.version}</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </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>build-config/checkstyle.xml</configLocation>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.adobe.testing</groupId>
              <artifactId>s3mock-build-config</artifactId>
              <version>${project.version}</version>
            </dependency>
            <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.version}</release>
            <encoding>${project.build.sourceEncoding}</encoding>
          </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>
          <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.5,)</version>
              </requireMavenVersion>
              <requireJavaVersion>
                <version>${java.version}</version>
              </requireJavaVersion>
            </rules>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-failsafe-plugin.version}</version>
          <configuration>
            <failIfNoTests>true</failIfNoTests>
          </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>
            <source>${java.version}</source>
            <detectJavaApiLink>false</detectJavaApiLink>
          </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>
            <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</goal>
              </goals>
              <phase>package</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
          <configuration>
            <failIfNoTests>true</failIfNoTests>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.1.0</version>
        </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>
          <configuration>
            <jvmTarget>1.8</jvmTarget>
          </configuration>
          <executions>
            <execution>
              <id>compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                  <sourceDir>${project.basedir}/src/main/java</sourceDir>
                </sourceDirs>
              </configuration>
            </execution>
            <execution>
              <id>test-compile</id>
              <goals>
                <goal>test-compile</goal>
              </goals>
              <configuration>
                <sourceDirs>
                  <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                  <sourceDir>${project.basedir}/src/test/java</sourceDir>
                </sourceDirs>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexus-staging-maven-plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <serverId>ossrh</serverId>
          </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.mycila</groupId>
        <artifactId>license-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-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- add JAXB to classpath in Java 9 -->
    <profile>
      <id>java9+</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <properties>
        <jaxb.version>2.3.1</jaxb.version>
      </properties>
      <dependencies>
        <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>${jaxb.version}</version>
          <scope>provided</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
