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

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>org.synchronoss.cloud</groupId>
    <artifactId>nio-stream-storage</artifactId>
    <version>1.1.3</version>
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>A lightweight library to stream byte data using a combination of in memory and file storage.</description>
    <url>https://github.com/synchronoss/nio-stream-storage</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.12</version>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1.2</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <configuration>
                    <notimestamp>true</notimestamp>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-docs</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.4.201502262128</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <!-- BUNDLE, PACKAGE, CLASS, SOURCEFILE, METHOD -->
                                    <limits>
                                        <limit>
                                            <counter>LINE</counter>
                                            <!-- INSTRUCTION, LINE, BRANCH, COMPLEXITY, METHOD, CLASS -->
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.80</minimum>
                                        </limit>
                                        <limit>
                                            <counter>BRANCH</counter>
                                            <!-- TOTALCOUNT, COVEREDCOUNT, MISSEDCOUNT, COVEREDRATIO, MISSEDRATIO -->
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.80</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

        </plugins>

    </build>

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

    <scm>
        <connection>scm:git:https://github.com/synchronoss/nio-stream-storage.git</connection>
        <developerConnection>scm:git:git@github.com:synchronoss/nio-stream-storage.git</developerConnection>
        <url>git@github.com:synchronoss/nio-stream-storage.git</url>
    </scm>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/synchronoss/nio-stream-storage</url>
    </ciManagement>

    <developers>
        <developer>
            <id>silvano.riz</id>
            <name>Silvano Riz</name>
            <email>melozzola@gmail.com</email>
            <organization>Synchronoss</organization>
            <organizationUrl>http://www.synchronoss.com/</organizationUrl>
            <roles>
                <role>owner</role>
                <role>developer</role>
            </roles>
            <timezone>+0</timezone>
        </developer>
        <developer>
            <id>mcla</id>
            <name>Melissa Clarke</name>
            <email>melissac1@gmail.com</email>
            <organization>Synchronoss</organization>
            <organizationUrl>http://www.synchronoss.com/</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>+0</timezone>
        </developer>
        <developer>
            <id>cjbooms</id>
            <name>Conor Gallagher</name>
            <email>cjbooms@gmail.com</email>
            <organization>Synchronoss</organization>
            <organizationUrl>http://www.synchronoss.com/</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>+0</timezone>
        </developer>
    </developers>

    <profiles>

        <!--
        Release to maven central.
        Given that I cannot get the ssh connection from our CI and Github, I cannot set up the automatic release plugin.
        Therefore, some manual steps are needed before running the maven command
            * Update the version in all the poms
            * Commit and push
            * Run the command
                mvn clean deploy -Prelease
            * Tag the commit with nio-stream-storage-X-Y-Z
            * Update the version for the next dev cycle (SNAPSHOT)
        -->
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <inherited>false</inherited>
                        <configuration>
                            <serverId>sonatype-nexus-staging</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <stagingProfileId>b2828f5f73ba8</stagingProfileId>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <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>
                            <keyname>${synchronoss.opensource.key}</keyname>
                            <passphraseServerId>${synchronoss.opensource.key}</passphraseServerId>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>
</project>
