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

     Copyright 2017-2020 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.1.25</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>

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

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

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>

    <adoptopenjdk11.image.version>jdk-11.0.3_7-alpine</adoptopenjdk11.image.version>
    <alpine-glibc.image.version>alpine-3.9_glibc-2.29</alpine-glibc.image.version>

    <aws.version>1.11.488</aws.version>
    <aws-v2.version>2.7.19</aws-v2.version>

    <spring-boot.version>2.1.9.RELEASE</spring-boot.version>
    <spring-security-oauth2.version>2.3.5.RELEASE</spring-security-oauth2.version>
    <commons-codec.version>1.11</commons-codec.version>
    <commons-io.version>2.6</commons-io.version>
    <jackson.version>2.9.9</jackson.version>

    <junit-jupiter.version>5.5.1</junit-jupiter.version>
    <junit.version>4.13-beta-1</junit.version>

    <docker.image.name>adobe/s3mock</docker.image.name>

    <license-maven-plugin-git.version>3.0</license-maven-plugin-git.version>
    <checkstyle.version>8.35</checkstyle.version>
  </properties>

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

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit-jupiter.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>com.adobe.testing</groupId>
        <artifactId>s3mock</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.amazonaws</groupId>
        <artifactId>aws-java-sdk-s3</artifactId>
        <version>${aws.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>

      <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-xml</artifactId>
        <version>${jackson.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>

      <!--
          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>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M2</version>
          <configuration>
            <rules>
              <requireMavenVersion>
                <version>[3.5,)</version>
              </requireMavenVersion>
              <requireJavaVersion>
                <version>${java.version}</version>
              </requireJavaVersion>
            </rules>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring-boot.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <encoding>${project.build.sourceEncoding}</encoding>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
          <executions>
            <execution>
              <id>sources</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.1.1</version>
          <configuration>
            <quiet>true</quiet>
            <source>${java.version}</source>
            <target>${java.version}</target>
          </configuration>
          <executions>
            <execution>
              <id>javadoc</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.0.0-M1</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.0.0-M1</version>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <goals>deploy -DskipTests -Prelease -Ppush-docker-image</goals>
            <preparationGoals>clean install</preparationGoals>
            <tagNameFormat>@{project.version}</tagNameFormat>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.8</version>
          <extensions>true</extensions>
          <configuration>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
            <nexusUrl>
              https://oss.sonatype.org/
            </nexusUrl>
            <serverId>ossrh</serverId>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M3</version>
          <configuration>
            <failIfNoTests>true</failIfNoTests>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>3.0.0-M3</version>
          <configuration>
            <failIfNoTests>true</failIfNoTests>
          </configuration>
        </plugin>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>0.30.0</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </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>
          </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>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <gpgArguments>
              <arg>--pinentry-mode</arg>
              <arg>loopback</arg>
            </gpgArguments>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.1.1</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.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${checkstyle.version}</version>
            </dependency>
            <dependency>
              <groupId>com.adobe.testing</groupId>
              <artifactId>s3mock-build-config</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>check-style</id>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-maven-and-jdk</id>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-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.0</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>

  <!-- 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>

  <developers>
    <developer>
      <name>Andreas Gudian</name>
      <email>gudian@adobe.com</email>
      <organization>Adobe</organization>
      <organizationUrl>https://www.adobe.com</organizationUrl>
    </developer>
    <developer>
      <name>Timo Eckhardt</name>
      <email>eckhardt@adobe.com</email>
      <organization>Adobe</organization>
      <organizationUrl>https://www.adobe.com</organizationUrl>
    </developer>
  </developers>
</project>
