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

     Copyright 2017-2018 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.0.1</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/master</url>
        <tag>2.0.1</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>
        <start-class>com.adobe.testing.s3mock.S3MockApplication</start-class>

        <openjdk.version>8u151</openjdk.version>
        <aws.version>1.11.310</aws.version>

        <spring-boot.version>2.0.1.RELEASE</spring-boot.version>
        <commons-codec.version>1.11</commons-codec.version>
        <xstream.version>1.4.10</xstream.version>
        <commons-io.version>2.6</commons-io.version>

        <junit-jupiter.version>5.1.1</junit-jupiter.version>

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

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

    <modules>
        <module>server</module>
        <module>testsupport</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <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>com.thoughtworks.xstream</groupId>
                <artifactId>xstream</artifactId>
                <version>${xstream.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>4.12</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <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.0.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.7.0</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</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.0.0</version>
                    <configuration>
                        <quiet>true</quiet>
                    </configuration>
                    <executions>
                        <execution>
                            <id>javadoc</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</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>2.21.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.21.0</version>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>0.25.0</version>
                </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>**/*.jks</exclude>
                            <exclude>**/sample*.txt</exclude>
                            <exclude>COPYRIGHT</exclude>
                            <exclude>LICENSE</exclude>
                            <exclude>AUTHORS</exclude>
                            <exclude>README.md</exclude>
                            <exclude>.travis.yml</exclude>
                            <exclude>.travis/**</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>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <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>push-docker-image</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>tag-docker-image-commit-id</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>push</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </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>
