<?xml version="1.0"?>
<project 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"
         xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.paypal.butterfly</groupId>
    <artifactId>butterfly-parent</artifactId>
    <version>2.5.0</version>

    <packaging>pom</packaging>
    <name>${project.artifactId}</name>
    <description>Butterfly parent artifact</description>
    <url>https://github.com/paypal/butterfly</url>

    <licenses>
        <license>
            <name>MIT</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Fabio Carvalho</name>
            <email>facarvalho@paypal.com</email>
            <organization>PayPal</organization>
            <organizationUrl>http://www.paypal.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:paypal/butterfly.git</connection>
        <developerConnection>scm:git:git@github.com:paypal/butterfly.git</developerConnection>
        <url>git@github.com:paypal/butterfly.git</url>
    </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>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <spring.boot.version>1.4.0.RELEASE</spring.boot.version>
        <coverage.line>80</coverage.line>
        <coverage.branch>80</coverage.branch>
        <encoding>UTF-8</encoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.paypal.butterfly</groupId>
                <artifactId>butterfly-extensions-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.paypal.butterfly</groupId>
                <artifactId>butterfly-utilities</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-model</artifactId>
                <version>3.3.9</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.5</version>
            </dependency>
            <dependency>
                <groupId>net.lingala.zip4j</groupId>
                <artifactId>zip4j</artifactId>
                <version>1.3.2</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>annotations</artifactId>
                <version>3.0.0</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.4</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.14.2</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>aopalliance</groupId>
                        <artifactId>aopalliance</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.lightcouch</groupId>
                <artifactId>lightcouch</artifactId>
                <version>0.1.8</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.7</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.10.19</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-testng</artifactId>
                <version>1.6.5</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito</artifactId>
                <version>1.6.5</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>butterfly-facade</module>
        <module>butterfly-extensions-api</module>
        <module>butterfly-utilities</module>
        <module>butterfly-core</module>
        <module>butterfly-cli</module>
        <module>butterfly-cli-package</module>
        <module>butterfly-metrics-couchdb</module>
        <module>butterfly-metrics-file</module>
        <module>tests</module>
    </modules>

    <profiles>
        <profile>
            <id>ossrh</id>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </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>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphrase>${gpg.passphrase}</passphrase>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
        				<groupId>org.sonatype.plugins</groupId>
        				<artifactId>nexus-staging-maven-plugin</artifactId>
        				<version>1.6.8</version>
        				<extensions>true</extensions>
        				<configuration>
              				<serverId>ossrh</serverId>
          					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
          					<!-- update this with the correct id! -->
          					<stagingProfileId>ee3714f400922</stagingProfileId>
        				</configuration>
      				</plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <check>
                        <lineRate>${coverage.line}</lineRate>
                        <packageLineRate>${coverage.line}</packageLineRate>
                        <totalLineRate>${coverage.line}</totalLineRate>
                        <branchRate>${coverage.branch}</branchRate>
                        <packageBranchRate>${coverage.branch}</packageBranchRate>
                        <totalBranchRate>${coverage.branch}</totalBranchRate>
                        <haltOnFailure>false</haltOnFailure>
                    </check>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>clean</goal>
                            <goal>cobertura</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <reportSets>
                    <reportSet>
                        <id>cobertura-report</id>
                        <reports>
                            <report>clean</report>
                            <report>cobertura</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

</project>
