<?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>io.arivera.oss</groupId>
    <artifactId>embedded-rabbitmq</artifactId>
    <version>1.4.0</version>
    <packaging>jar</packaging>

    <name>Embedded RabbitMQ</name>
    <description>
        A library to facilitate running RabbitMQ directly from a JVM application as if it was an embedded service.
    </description>
    <url>http://github.com/AlejandroRivera/embedded-rabbitmq</url>

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

    <inceptionYear>2016</inceptionYear>
    <developers>
        <developer>
            <name>Alejandro Rivera</name>
            <email>alejandro.rivera.lopez@gmail.com</email>
            <roles>
                <role>Creator</role>
                <role>Maintainer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <url>http://github.com/AlejandroRivera/embedded-rabbitmq/tree/master</url>
        <connection>scm:git:https://github.com/AlejandroRivera/embedded-rabbitmq.git</connection>
        <developerConnection>scm:git:git@github.com:AlejandroRivera/embedded-rabbitmq.git</developerConnection>
      <tag>v1.4.0</tag>
  </scm>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/AlejandroRivera/embedded-rabbitmq</url>
    </ciManagement>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/AlejandroRivera/embedded-rabbitmq/issues</url>
    </issueManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

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

    <dependencies>
        <dependency>
            <!-- Logging Facade -->
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
        </dependency>
        <dependency>
            <!-- Used to decompress TAR (+GZ) files -->
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
            <version>1.19</version>
        </dependency>
        <dependency>
            <!-- Used to decompress XZ files -->
            <groupId>org.tukaani</groupId>
            <artifactId>xz</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <!-- Used to manage OS process execution -->
            <groupId>org.zeroturnaround</groupId>
            <artifactId>zt-exec</artifactId>
            <version>1.9</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                    <!-- newer version defined by this project -->
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <!-- Useful for testing connectivity to the RabbitMQ process started by this library -->
            <groupId>com.rabbitmq</groupId>
            <artifactId>amqp-client</artifactId>
            <version>4.8.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <!-- For logging purposes during tests execution -->
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.3</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                    <!-- newer version defined by this project -->
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <!-- Test framework -->
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <!-- Mocking framwork for testing -->
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.10.19</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <!-- Used to facilitate testing -->
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <!-- Checks against dependency version issues -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <dependencyConvergence />
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- Sonatype Nexus repository deployment plugin. -->
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-snapshots</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>

            <plugin>
                <!-- Code Coverage tool -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.7.201606060606</version>
                <executions>
                    <execution>
                        <!-- Ensures execution of tests include recording of usage through JaCoCo agent (via auto-binding) -->
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <!-- Ensures we execute `mvn jacoco:check` during the `verify` phase (via auto-binding)-->
                        <id>verify</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>io/arivera/oss/embedded/rabbitmq/apache/**</exclude>
                        <exclude>io/arivera/oss/embedded/rabbitmq/util/*</exclude>
                    </excludes>
                    <rules>
                        <rule>
                            <element>BUNDLE</element>
                            <limits>
                                <limit><counter>INSTRUCTION</counter><value>COVEREDRATIO</value><minimum>0.50</minimum></limit>
                                <limit><counter>CLASS</counter><value>MISSEDCOUNT</value><maximum>15</maximum></limit>
                                <limit><counter>BRANCH</counter><value>COVEREDRATIO</value><minimum>0.20</minimum></limit>
                            </limits>
                        </rule>
                        <rule>
                            <element>CLASS</element>
                            <excludes><exclude>*Test</exclude></excludes>
                            <limits>
                                <limit> <counter>LINE</counter><value>COVEREDRATIO</value><minimum>0.00</minimum></limit>
                            </limits>
                        </rule>
                    </rules>
                </configuration>
            </plugin>

            <plugin>
                <!-- Coveralls collects Code Coverage reports from Travis. -->
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.2.0</version>
                <configuration>
                    <!-- Will come from Travis secured env var. -->
                    <repoToken>${env.COVERALLS_TOKEN}</repoToken>
                    <failOnServiceError>false</failOnServiceError>
                </configuration>
            </plugin>

            <plugin>
                <!-- CheckStyle plugin to enforce coding standards -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <encoding>UTF-8</encoding>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <linkXRef>false</linkXRef>
                    <excludes>io/arivera/oss/embedded/rabbitmq/apache/commons/**</excludes>
                </configuration>
                <dependencies>
                    <dependency>
                        <!-- Override default v6.11.2 since it's older. Can't use v7.X due to JDK 8 incompatibility -->
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>6.19</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <!-- Execute `checkstyle:check` to fail the build during the `verify` phase -->
                        <id>check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- Using FindBugs to prevent bugs that are identifiable by static analysis -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <onlyAnalyze>io.arivera.-</onlyAnalyze>
                    <fork>false</fork>
                    <threshold>Low</threshold>
                    <effort>Max</effort>
                    <xmlOutput>true</xmlOutput>
                </configuration>
                <executions>
                    <execution>
                        <!-- Execue CheckStyle during the 'verify' phase automatically (via auto-binding) -->
                        <id>check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>

                    <plugin>
                        <!-- Sonatype/Maven Central requires signing of artifacts -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <!-- Generate artifact for source code-->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <!-- Generate JavaDoc artifact -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

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

</project>
