<?xml version="1.0" encoding="UTF-8"?>
<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.expedia.www</groupId>
    <artifactId>blobs</artifactId>
    <version>1.0.3</version>
    <packaging>pom</packaging>

    <modules>
        <module>core</module>
        <module>haystack-blobs</module>
        <module>stores</module>
    </modules>

    <scm>
        <connection>scm:git:git://github.com/mchandramouli/blobs.git</connection>
        <developerConnection>scm:git:ssh://github.com/mchandramouli/blobs.git</developerConnection>
        <url>http://github.com/mchandramouli/blobs</url>
    </scm>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>
	Set of libraries that allow one to write serialized files with metadata to external storage
	and read back
    </description>
    <url>https://github.com/mchandramouli/blobs/tree/master</url>

    <licenses>
        <!--
           /*
            *
            *  Copyright 2017 Expedia, Inc.
            *
            *     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.
            *
            */
          -->
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>haystack</id>
            <name>Haystack Team</name>
            <email>haystack@expedia.com</email>
            <url>https://github.com/ExpediaDotCom/haystack</url>
        </developer>
    </developers>

    <properties>
        <project.jdk.version>1.8</project.jdk.version>
        <scala.major.version>2</scala.major.version>
        <scala.minor.version>12</scala.minor.version>
        <scala.tiny.version>5</scala.tiny.version>
        <scala.major.minor.version>${scala.major.version}.${scala.minor.version}</scala.major.minor.version>
        <scala-library.version>${scala.major.version}.${scala.minor.version}.${scala.tiny.version}</scala-library.version>

        <slf4j-api.version>1.7.25</slf4j-api.version>
        <commons-lang3.version>3.4</commons-lang3.version>
        <commons-lang.version>2.6</commons-lang.version>
        <commons-io.version>2.6</commons-io.version>
        <guava.version>19.0</guava.version>

        <pegdown.version>1.6.0</pegdown.version>
        <scalatest.version>3.0.3</scalatest.version>
        <scoverage.plugin.version>1.3.0</scoverage.plugin.version>
        <scalastyle.config.location>${basedir}/../checkstyles/scalastyle_config.xml</scalastyle.config.location>
        <junit.version>4.12</junit.version>
        <easymock.version>3.4</easymock.version>
        <mockito.version>2.28.2</mockito.version>

        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.1.0</maven-javadoc-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <scalatest-maven-plugin.version>1.0</scalatest-maven-plugin.version>
        <scalastyle-maven-plugin.version>0.8.0</scalastyle-maven-plugin.version>
        <scala-maven-plugin.version>3.2.1</scala-maven-plugin.version>
        <maven-compiler-plugin.version>3.6.1</maven-compiler-plugin.version>
        <jacoco-maven-plugin.version>0.7.4.201502262128</jacoco-maven-plugin.version>
        <skipGpg>true</skipGpg>
        <haystack-agent-core.version>0.1.7-SNAPSHOT</haystack-agent-core.version>
        <haystack-client-core.version>0.2.8-SNAPSHOT</haystack-client-core.version>
        <!--Need to check the working of s3 while updating the version as it will cause
        s3 upload in haystack-agent to fail due to incompatible versions of `aws-java-sdk-core`-->
        <aws-java-sdk-s3.version>1.11.128</aws-java-sdk-s3.version>
        <snappy.version>1.1.7.3</snappy.version>
        <fastinfoset.version>1.2.16</fastinfoset.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- scala -->
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala-library.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-reflect</artifactId>
                <version>${scala-library.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j-api.version}</version>
            </dependency>

            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>${commons-lang.version}</version>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>com.revinate</groupId>
                <artifactId>guava-rate-limiter</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>com.expedia.www</groupId>
                <artifactId>haystack-agent-api</artifactId>
                <version>${haystack-agent-core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.xerial.snappy</groupId>
                <artifactId>snappy-java</artifactId>
                <version>${snappy.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.fastinfoset</groupId>
                <artifactId>FastInfoset</artifactId>
                <version>${fastinfoset.version}</version>
            </dependency>


            <!-- Test Dependencies  -->
            <dependency>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest_${scala.major.minor.version}</artifactId>
                <version>${scalatest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.pegdown</groupId>
                <artifactId>pegdown</artifactId>
                <version>${pegdown.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.easymock</groupId>
                <artifactId>easymock</artifactId>
                <version>${easymock.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.7.25</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.scalatest</groupId>
                    <artifactId>scalatest-maven-plugin</artifactId>
                    <version>${scalatest-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>test</id>
                            <goals>
                                <goal>test</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.scalastyle</groupId>
                    <artifactId>scalastyle-maven-plugin</artifactId>
                    <version>${scalastyle-maven-plugin.version}</version>
                    <configuration>
                        <failOnViolation>true</failOnViolation>
                        <failOnWarning>false</failOnWarning>
                        <configLocation>${scalastyle.config.location}</configLocation>
                        <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
                        <testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
                        <outputFile>${project.build.directory}/scalastyle-output.xml</outputFile>
                        <outputEncoding>UTF-8</outputEncoding>
                    </configuration>
                    <executions>
                        <execution>
                            <id>compile-scalastyle</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <phase>compile</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>${scala-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>scala-compile-first</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>add-source</goal>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>scala-test-compile</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${project.jdk.version}</source>
                        <target>${project.jdk.version}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <show>public</show>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <configuration>
                        <haltOnFailure>true</haltOnFailure>
                        <rules>
                            <rule>
                                <element>CLASS</element>
                                <limits>
                                    <limit>
                                        <counter>LINE</counter>
                                        <value>COVEREDRATIO</value>
                                        <minimum>0.67</minimum>
                                    </limit>
                                </limits>
                            </rule>
                        </rules>
                    </configuration>
                    <executions>
                        <execution>
                            <id>jacoco-initialize</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>jacoco-report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>jacoco-check</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <configuration>
                    <skip>${skipGpg}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
