<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-multipart</artifactId>
    <version>1.1.0</version>
    <packaging>pom</packaging>
    <name>nio-multipart</name>
    <url>https://github.com/synchronoss/nio-multipart</url>

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

    <modules>
        <module>nio-multipart-parser</module>
    </modules>

    <dependencyManagement>
        <dependencies>

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

            <dependency>
                <groupId>org.synchronoss.cloud</groupId>
                <artifactId>nio-stream-storage</artifactId>
                <version>1.1.3</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>

        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <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.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <!--<version>0.7.5.201505241946</version>-->
                    <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>
                                        <!--<excludes>-->
                                        <!--<exclude></exclude>-->
                                        <!--</excludes>-->
                                    </rule>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

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

                <!--  Artifact signing  -->
                <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>
        </pluginManagement>

        <plugins>

            <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-multipart.git</connection>
        <developerConnection>scm:git:git@github.com:synchronoss/nio-multipart.git</developerConnection>
        <url>https://github.com/synchronoss/nio-multipart</url>
    </scm>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/synchronoss/nio-multipart</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>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-multipart-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.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!--
        Integration Tests
        mvn clean verify -pl integration-tests -Pintegration-tests -Dapplication.server.port=8181 -Pjmeter
        -->
        <profile>
            <id>integration-tests</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>integration-tests</module>
            </modules>
        </profile>
    </profiles>

</project>