<?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.honeybadger</groupId>
    <artifactId>honeybadger-parent</artifactId>
    <version>2.1.2</version>
    <packaging>pom</packaging>
    <modules>
        <module>honeybadger-java</module>
        <module>honeybadger-java-shaded</module>
    </modules>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://raw.githubusercontent.com/honeybadger-io/honeybadger-java/master/LICENSE</url>
        </license>
    </licenses>

    <name>Honeybadger Java Client</name>
    <description>Library that sends exceptions to the online error management service Honeybadger</description>
    <url>https://github.com/honeybadger-io/honeybadger-java</url>
    <organization>
        <name>Honeybadger.io</name>
        <url>https://honeybadger.io</url>
    </organization>

    <developers>
        <developer>
            <id>elijah</id>
            <name>Elijah Zupancic</name>
            <email>elijah@zupancic.name</email>
            <organizationUrl>https://github.com/dekobon</organizationUrl>
        </developer>
        <developer>
            <id>JasonTrue</id>
            <name>Jason Truesdell</name>
            <email>jason@yuzuten.com</email>
            <organizationUrl>https://github.com/JasonTrue</organizationUrl>
        </developer>
        <developer>
            <id>joshuap</id>
            <name>Joshua Wood</name>
            <email>josh@joshuawood.net</email>
            <organizationUrl>https://github.com/joshuap</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:honeybadger-io/honeybadger-java.git</connection>
        <developerConnection>scm:git:git@github.com:honeybadger-io/honeybadger-java.git</developerConnection>
        <url>git@github.com:honeybadger-io/honeybadger-java.git</url>
        <tag>honeybadger-parent-2.1.2</tag>
    </scm>
    <issueManagement>
        <system>github.com</system>
        <url>https://github.com/honeybadger-io/honeybadger-java/issues</url>
    </issueManagement>
    <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>
        <checkstyle.skip>false</checkstyle.skip>
        <maven.test.skip>false</maven.test.skip>
        <maven.integration.test.skip>false</maven.integration.test.skip>
        <java.min.src.version>1.8</java.min.src.version>
        <java.min.target.version>1.8</java.min.target.version>
        <maven.min.version>3.0.5</maven.min.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <surefire.forkCount>1</surefire.forkCount>
        <surefire.useSystemClassLoader>true</surefire.useSystemClassLoader>
        <failsafe.forkCount>1</failsafe.forkCount>
        <failsafe.useSystemClassLoader>true</failsafe.useSystemClassLoader>
        <!-- Only for Java 8 support, per https://errorprone.info/docs/installation -->
        <javac.version>9+181-r4173-1</javac.version>

        <!-- Dependency versions -->
        <dependency.apache-commons.version>3.12.0</dependency.apache-commons.version>
        <dependency.checkstyle.version>10.5.0</dependency.checkstyle.version>
        <dependency.slfj.version>2.0.6</dependency.slfj.version>
        <dependency.servlet-api.version>4.0.1</dependency.servlet-api.version>
        <dependency.play.version>2.8.19</dependency.play.version>
        <dependency.spring.version>5.3.23</dependency.spring.version>
        <dependency.jackson.version>2.14.2</dependency.jackson.version>
        <dependency.fluent-hc.version>4.5.14</dependency.fluent-hc.version>
        <dependency.jcabi-manifests.version>1.2.1</dependency.jcabi-manifests.version>
        <dependency.mustache.version>0.9.10</dependency.mustache.version>
        <!-- Test Dependency Versions -->
        <dependency.junit.version>4.13.2</dependency.junit.version>
        <dependency.guava.version>31.1-jre</dependency.guava.version>
        <dependency.mockito.version>4.5.0</dependency.mockito.version>
        <dependency.logback.version>1.2.11</dependency.logback.version>
        <dependency.json-schema-validator>2.2.6</dependency.json-schema-validator>

        <!-- Plugin versions -->
        <maven-checkstyle-plugin.version>3.2.1</maven-checkstyle-plugin.version>
        <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
        <maven-build-helper-plugin>1.10</maven-build-helper-plugin>
        <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.4.0</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>3.0.0</maven-deploy-plugin.version>
        <maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
        <maven-extra-enforcer-rules.version>1.6.1</maven-extra-enforcer-rules.version>
        <maven-failsafe-plugin.version>3.0.0-M8</maven-failsafe-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
        <maven-jarsigner-plugin.version>3.0.0</maven-jarsigner-plugin.version>
        <maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
        <maven-jxr-plugin.version>3.3.0</maven-jxr-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
        <maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
        <maven-cargo-plugin.version>1.6.7</maven-cargo-plugin.version>
        <maven-project-info-reports-plugin.version>3.4.2</maven-project-info-reports-plugin.version>
        <!-- Maven plugin dependency versions -->
        <maven-error-prone-core.version>2.9.0</maven-error-prone-core.version>
        <maven-directory-maven-plugin.version>0.3.1</maven-directory-maven-plugin.version>
        <maven-build-helper-maven-plugin.version>3.3.0</maven-build-helper-maven-plugin.version>
        <maven-maven-resources-plugin.version>3.0.2</maven-maven-resources-plugin.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.2.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${dependency.checkstyle.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <!-- This property is generated so we can refer to
                     another module in a multi-module project without
                     brittle relative paths. -->
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>${maven-directory-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>directory-of-property</id>
                        <goals>
                            <goal>directory-of</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <property>multi.module.root</property>
                            <project>
                                <groupId>io.honeybadger</groupId>
                                <artifactId>honeybadger-java</artifactId>
                            </project>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- checkstyle is enabled in the site goal for now. There are too many errors
                 to add it to the build phase. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${dependency.checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <consoleOutput>false</consoleOutput>
                    <skip>${checkstyle.skip}</skip>
                    <suppressionsLocation>suppressions.xml</suppressionsLocation>
                    <violationSeverity>warning</violationSeverity>
                </configuration>
                <!--<executions>-->
                    <!--<execution>-->
                        <!--<id>checkstyle</id>-->
                        <!--<phase>validate</phase>-->
                        <!--<goals>-->
                            <!--<goal>check</goal>-->
                        <!--</goals>-->
                    <!--</execution>-->
                <!--</executions>-->
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${maven-build-helper-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>add-test-source</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/integration/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>${maven-clean-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <fork>true</fork>
                    <source>${java.min.src.version}</source>
                    <target>${java.min.target.version}</target>
                    <compilerArgs>
                        <arg>-XDcompilePolicy=simple</arg>
                        <arg>-Xplugin:ErrorProne</arg>
                        <arg>-Xlint:all</arg>
                    </compilerArgs>
                    <showWarnings>true</showWarnings>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>com.google.errorprone</groupId>
                            <artifactId>error_prone_core</artifactId>
                            <version>${maven-error-prone-core.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.google.errorprone</groupId>
                        <artifactId>error_prone_core</artifactId>
                        <version>${maven-error-prone-core.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven-dependency-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[${maven.min.version},)</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-bytecode-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <enforceBytecodeVersion>
                                    <maxJdkVersion>${java.min.target.version}</maxJdkVersion>
                                </enforceBytecodeVersion>
                            </rules>
                            <fail>false</fail>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-ban-circular-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banCircularDependencies />
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>${maven-extra-enforcer-rules.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>${maven-install-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Honeybadger-Java-Version>${project.version}</Honeybadger-Java-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jarsigner-plugin</artifactId>
                <version>${maven-jarsigner-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <source>8</source>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <forkCount>${surefire.forkCount}</forkCount>
                    <skip>${maven.test.skip}</skip>
                    <systemPropertyVariables>
                    </systemPropertyVariables>
                    <useSystemClassLoader>${surefire.useSystemClassLoader}</useSystemClassLoader>
                    <systemProperties>
                        <java.util.logging.config.file>
                            ${project.build.testOutputDirectory}/logging.properties
                        </java.util.logging.config.file>
                    </systemProperties>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${maven-jxr-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <consoleOutput>false</consoleOutput>
                    <skip>${checkstyle.skip}</skip>
                    <suppressionsLocation>suppressions.xml</suppressionsLocation>
                    <violationSeverity>warning</violationSeverity>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <!--<plugin>-->
                <!--<groupId>org.apache.maven.plugins</groupId>-->
                <!--<artifactId>maven-checkstyle-plugin</artifactId>-->
                <!--<version>${maven-checkstyle-plugin.version}</version>-->
                <!--<dependencies>-->
                    <!--<dependency>-->
                        <!--<groupId>com.puppycrawl.tools</groupId>-->
                        <!--<artifactId>checkstyle</artifactId>-->
                        <!--<version>${dependency.checkstyle.version}</version>-->
                    <!--</dependency>-->
                <!--</dependencies>-->
                <!--<configuration>-->
                    <!--<configLocation>checkstyle.xml</configLocation>-->
                    <!--<consoleOutput>false</consoleOutput>-->
                    <!--<skip>${checkstyle.skip}</skip>-->
                    <!--<suppressionsLocation>suppressions.xml</suppressionsLocation>-->
                    <!--<violationSeverity>warning</violationSeverity>-->
                <!--</configuration>-->

                <!--<reportSets>-->
                    <!--<reportSet>-->
                        <!--<reports>-->
                            <!--<report>checkstyle</report>-->
                        <!--</reports>-->
                    <!--</reportSet>-->
                <!--</reportSets>-->
            <!--</plugin>-->
        </plugins>
    </reporting>

    <profiles>
        <!--
        The release profile only needs activated when cutting a release for maven central.
        It will generate additional artifacts for javadoc and source as well as GPG signatures for each artifact.
        This profile also assumes that the properties for the gpg plugin (such as gpg.keyname and gpg.passphrase
        are either defined in a settings.xml file or similar facility.
        -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#extra-setup-for-pomxml -->
                                    <!-- Prevent gpg from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <includeDependencySources>true</includeDependencySources>
                            <dependencySourceIncludes>
                                <dependencySourceInclude>
                                    io.honeybadger:honeybadger-java
                                </dependencySourceInclude>
                            </dependencySourceIncludes>
                            <includeTransitiveDependencySources>true</includeTransitiveDependencySources>
                            <additionalDependencies>
                                <dependency>
                                    <groupId>javax.servlet</groupId>
                                    <artifactId>javax.servlet-api</artifactId>
                                    <version>${dependency.servlet-api.version}</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.typesafe.play</groupId>
                                    <artifactId>play_2.12</artifactId>
                                    <version>${dependency.play.version}</version>
                                </dependency>
                                <dependency>
                                    <groupId>com.typesafe</groupId>
                                    <artifactId>config</artifactId>
                                    <version>1.3.3</version>
                                </dependency>
                                <dependency>
                                    <groupId>org.springframework</groupId>
                                    <artifactId>spring-webmvc</artifactId>
                                    <version>${dependency.spring.version}</version>
                                </dependency>
                                <dependency>
                                    <groupId>org.springframework</groupId>
                                    <artifactId>spring-beans</artifactId>
                                    <version>${dependency.spring.version}</version>
                                </dependency>
                                <dependency>
                                    <groupId>org.springframework</groupId>
                                    <artifactId>spring-core</artifactId>
                                    <version>${dependency.spring.version}</version>
                                </dependency>

                            </additionalDependencies>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- using github.com/google/error-prone-javac is required when running on JDK 8 -->
            <!-- See https://errorprone.info/docs/installation -->
            <id>jdk8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <fork>true</fork>
                            <compilerArgs combine.children="append">
                                <arg>
                                    -J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar
                                </arg>
                            </compilerArgs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- Current versions of Error-Prone fail on JDK 12, so we disable it
                 when building with JDK 12 -->
            <id>jdk12</id>
            <activation>
                <jdk>12</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <fork>true</fork>
                            <compilerArgs>
                                <arg>-XDcompilePolicy=simple</arg>
                                <arg>-Xlint:all</arg>
                            </compilerArgs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
