<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/maven-v4_0_0.xsd">
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.codereligion</groupId>
    <artifactId>bugsnag-logback</artifactId>
    <version>1.0.0</version>

    <name>Bugsnag-Logback</name>
    <description>Bugsnag notifier for Logback</description>
    <url>https://github.com/codereligion/bugsnag-logback</url>

    <developers>
        <developer>
            <id>SierraGolf</id>
            <name>Sebastian Gröbler</name>
        </developer>
    </developers>

    <scm>
        <url>scm:git:ssh://git@github.com:codereligion/bugsnag-logback.git</url>
        <connection>scm:git:ssh://git@github.com:codereligion/bugsnag-logback.git</connection>
        <developerConnection>scm:git:git@github.com:codereligion/bugsnag-logback.git</developerConnection>
        <tag>bugsnag-logback-1.0.0</tag>
    </scm>

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

    <prerequisites>
        <maven>3.1</maven>
    </prerequisites>

    <properties>
        <!-- basic maven properties -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <resources.plugin.version>2.6</resources.plugin.version>
        <compiler.plugin.version>3.1</compiler.plugin.version>
        <surefire.plugin.version>2.16</surefire.plugin.version>
        <failsafe.plugin.version>2.16</failsafe.plugin.version>
        <license.plugin.version>1.9.0</license.plugin.version>
        <source.plugin.version>2.2.1</source.plugin.version>
        <javadoc.plugin.version>2.9.1</javadoc.plugin.version>
        <release.plugin.version>2.4.2</release.plugin.version>
        <build.helper.plugin.version>1.8</build.helper.plugin.version>
        <scm.plugin.version>1.8.1</scm.plugin.version>
        <gmaven.plugin.version>1.4</gmaven.plugin.version>

        <!-- dependency versions -->
        <logback.version>1.0.13</logback.version>
        <resteasy.version>3.0.6.Final</resteasy.version>
        <guava.version>15.0</guava.version>
        <commons-io.version>2.4</commons-io.version>
        <gson.version>2.2.4</gson.version>
        <slf4j.version>1.7.5</slf4j.version>

        <!-- test dependency versions -->
        <hamcrest.version>1.3</hamcrest.version>
        <wiremock.version>1.40</wiremock.version>
        <junit.version>4.11</junit.version>
        <mockito.version>1.9.0</mockito.version>

        <!-- ci properties -->
        <jacoco.version>0.6.2.201302030002</jacoco.version>
        <skip.code.coverage>true</skip.code.coverage>

        <!-- sonar properties -->
        <sonar.sourceEncoding>${project.build.sourceEncoding}</sonar.sourceEncoding>
        <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
        <sonar.jacoco.reportPath>${project.build.directory}/jacoco-ut.exec</sonar.jacoco.reportPath>
        <sonar.jacoco.itReportPath>${project.build.directory}/jacoco-it.exec</sonar.jacoco.itReportPath>
    </properties>

    <!-- Dependencies -->
    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>${resteasy.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client</artifactId>
            <version>${resteasy.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-access</artifactId>
            <version>${logback.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>

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

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock</artifactId>
            <version>${wiremock.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>log4j</artifactId>
                    <groupId>log4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>

            <!-- add example folder to test-sources -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build.helper.plugin.version}</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src/example/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- read ExampleMetaDataProvider.java into property -->
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <version>${gmaven.plugin.version}</version>
                <configuration>
                    <properties>
                        <exampleMetaDataProviderPath>${project.basedir}/src/example/java/com/codereligion/bugsnag/logback/ExampleMetaDataProvider.java</exampleMetaDataProviderPath>
                    </properties>
                    <source>
                        project.properties.exampleMetaDataProvider = new
                        File(project.properties.exampleMetaDataProviderPath).getText()
                    </source>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- copy resources and replace variables -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${resources.plugin.version}</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.basedir}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/templates</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- compilation -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.plugin.version}</version>
                <configuration>
                    <!-- try build for the currently set java specification version, e.g.
                        1.6 -->
                    <source>${java.specification.version}</source>
                    <target>${java.specification.version}</target>

                    <!-- check for warnings, fail and show if there are any -->
                    <showWarnings>true</showWarnings>
                    <compilerArgs>
                        <arg>-proc:none</arg>
                        <arg>-Werror</arg>
                        <arg>-Xlint</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <!-- testing -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.plugin.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${failsafe.plugin.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

            <!-- licensing -->
            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>${license.plugin.version}</version>
                <configuration>
                    <header>LICENSE_HEADER.txt</header>
                    <strictCheck>true</strictCheck>
                    <includes>
                        <include>src/</include>
                    </includes>
                    <excludes>
                        <exclude>**/ExampleMetaDataProvider.java</exclude>
                        <exclude>**/logback-test.xml</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>check-license</id>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- sources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${source.plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- java doc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${javadoc.plugin.version}</version>
                <configuration>
                    <excludePackageNames>com.codereligion.diff.internal</excludePackageNames>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-docs</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- releasing -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${release.plugin.version}</version>
                <configuration>
                    <preparationGoals>
                        clean verify -Pcommit.readme.changes
                    </preparationGoals>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9</version>
                    </dependency>
                </dependencies>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>unit.test</id>

            <build>
                <plugins>

                    <!-- code coverage tool to be easily integration into sonar -->
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <configuration>
                            <!-- allows skipping of code coverage -->
                            <skip>${skip.code.coverage}</skip>

                            <!-- paths are defined by the sonar plugin -->
                            <destFile>${sonar.jacoco.reportPath}</destFile>

                            <!-- dump on test exit -->
                            <dumpOnExit>true</dumpOnExit>

                        </configuration>
                        <executions>
                            <execution>
                                <id>prepare-jacoco-ut</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- execute actual unit tests -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <excludes>
                                <exclude>**/*IntegrationTest.class</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <id>run.unit.tests</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>integration.test</id>
            <build>
                <plugins>

                    <!-- setup for code coverage -->
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <executions>
                            <execution>
                                <id>jacoco-prepare</id>
                                <phase>test</phase>
                                <configuration>
                                    <!-- allows skipping of code coverage -->
                                    <skip>${skip.code.coverage}</skip>

                                    <!-- paths are defined by the sonar plugin -->
                                    <destFile>${sonar.jacoco.itReportPath}</destFile>

                                    <!-- dump on test exit -->
                                    <dumpOnExit>true</dumpOnExit>

                                    <!-- name of the property to append the jacoco agent configuration to,
                               			this will also include the above configuration -->
                                    <propertyName>jvmArgs</propertyName>

                                </configuration>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>

                        </executions>
                    </plugin>

                    <!-- reserves ports -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <configuration>
                            <portNames>
                                <!-- create properties and assign the reserved ports -->
                                <portName>integration.test.port</portName>
                            </portNames>
                        </configuration>
                        <executions>
                            <execution>
                                <id>reserve-port</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>reserve-network-port</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- runs only integration tests -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                                <configuration>
                                    <skip>false</skip>
                                    <includes>
                                        <include>**/*IntegrationTest.class</include>
                                    </includes>
                                    <systemPropertyVariables>
                                        <integration.test.port>${integration.test.port}</integration.test.port>
                                    </systemPropertyVariables>
                                    <argLine>${jvmArgs}</argLine>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>commit.readme.changes</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-scm-plugin</artifactId>
                        <version>${scm.plugin.version}</version>
                        <configuration>
                            <includes>README.md</includes>
                            <message>[maven-release-plugin] updating version in README.md</message>
                        </configuration>
                        <executions>
                            <execution>
                                <id>update.readme.changes</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>checkin</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>