<?xml version="1.0"?>
<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.github.openunirest</groupId>
    <artifactId>unirest-java-adaptavist</artifactId>
    <packaging>jar</packaging>
    <version>2.6.55</version>
    <name>unirest-java</name>
    <description>Simplified, lightweight HTTP client library</description>
    <url>http://github.com/OpenUnirest/</url>

    <licenses>
        <license>
            <name>MIT</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <!--suppress UnresolvedMavenProperty -->
        <connection>scm:git:${env.BITBUCKET_GIT_HTTP_ORIGIN}</connection>
        <!--suppress UnresolvedMavenProperty -->
        <url>${env.BITBUCKET_GIT_HTTP_ORIGIN}</url>
        <!--suppress UnresolvedMavenProperty -->
        <developerConnection>scm:git:${env.BITBUCKET_GIT_HTTP_ORIGIN}</developerConnection>
        <tag>v2.6.55</tag>
    </scm>

    <developers>
        <developer>
            <id>Ryber</id>
            <name>Ryan Bergman</name>
            <url>https://github.com/OpenUnirest</url>
            <organization>OpenUnirest</organization>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>nexus</id>
            <url>https://nexus.adaptavist.net/content/repositories/external-snapshots</url>
        </snapshotRepository>
        <repository>
            <id>nexus</id>
            <url>https://nexus.adaptavist.net/content/repositories/external</url>
        </repository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jackson.version>2.14.2</jackson.version>
        <jetty.version>9.4.46.v20220331</jetty.version>
    </properties>

    <!-- This profile disables stricter Java 8 Javadoc, as it throws errors for org.java classes-->
    <profiles>
        <profile>
            <id>disable-java8-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
            </properties>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Built-By>Unirest</Built-By>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.6.0</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <id>auto-checkstyle</id>
                        <goals>
                            <goal>checkstyle</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configLocation>${basedir}/checkstyle.xml</configLocation>
                    <suppressionsLocation>${basedir}/suppressions.xml</suppressionsLocation>
                    <logViolationsToConsole>true</logViolationsToConsole>
                    <linkXRef>false</linkXRef>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.6</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.39</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <arguments>-DskipTests</arguments>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <localCheckout>true</localCheckout>
                    <pushChanges>true</pushChanges>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <fork>true</fork>
                    <meminitial>128m</meminitial>
                    <maxmem>512m</maxmem>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
            <plugin>
                <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</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <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>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.5.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <dependencies>
                    <dependency>
                        <groupId>org.sonatype.ossindex.maven</groupId>
                        <artifactId>ossindex-maven-enforcer-rules</artifactId>
                        <version>3.0.2</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>vulnerability-checks</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies">
                                    <excludeCoordinates>
                                        <exclude>
                                            # CVE-2020-15250
                                            # comes from org.apache.httpcomponents:httpclient:4.5.13
                                            <groupId>commons-codec</groupId>
                                            <artifactId>commons-codec</artifactId>
                                            <version>1.11</version>
                                        </exclude>
                                        <exclude>
                                            # direct dependency, no newer release yet
                                            <groupId>com.google.guava</groupId>
                                            <artifactId>guava</artifactId>
                                            <version>31.1-jre</version>
                                        </exclude>
                                        <exclude>
                                            # (test dependency) comes from com.sparkjava:spark-core:2.9.3, no newer release yet
                                            <groupId> org.eclipse.jetty</groupId>
                                            <artifactId>jetty-webapp</artifactId>
                                            <version>9.4.31.v20200723</version>
                                        </exclude>
                                        <exclude>
                                            # highest version of jackson right now
                                            <groupId>com.fasterxml.jackson.core</groupId>
                                            <artifactId>jackson-core</artifactId>
                                            <version>2.14.2</version>
                                        </exclude>
                                        <exclude>
                                            # test dependency
                                            <groupId>org.eclipse.jetty</groupId>
                                            <artifactId>jetty-http</artifactId>
                                            <version>9.4.46.v20220331</version>
                                        </exclude>
                                        <exclude>
                                            # test dependency
                                            <groupId>org.eclipse.jetty</groupId>
                                            <artifactId>jetty-server</artifactId>
                                            <version>9.4.46.v20220331</version>
                                        </exclude>
                                        <exclude>
                                            # test dependency
                                            <groupId>org.eclipse.jetty</groupId>
                                            <artifactId>jetty-client</artifactId>
                                            <version>9.4.46.v20220331</version>
                                        </exclude>
                                        <exclude>
                                            # test dependency
                                            <groupId>org.eclipse.jetty</groupId>
                                            <artifactId>jetty-util</artifactId>
                                            <version>9.4.46.v20220331</version>
                                        </exclude>
                                        <exclude>
                                            # test dependency
                                            <groupId>ch.qos.logback</groupId>
                                            <artifactId>logback-core</artifactId>
                                            <version>1.2.11</version>
                                        </exclude>
                                        <exclude>
                                            # test dependency
                                            <groupId>ch.qos.logback</groupId>
                                            <artifactId>logback-classic</artifactId>
                                            <version>1.2.11</version>
                                        </exclude>
                                    </excludeCoordinates>
                                </banVulnerable>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>1.8</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.13.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.13</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>4.5.13</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpasyncclient</artifactId>
            <version>4.1.4</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
            <version>4.1.17</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>1.2.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.14.0</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.mockito/mockito-all -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>2.0.2-beta</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>32.0.0-jre</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-guava -->
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-guava</artifactId>
            <version>${jackson.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-core</artifactId>
            <version>2.9.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
            <scope>compile</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-server -->
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.eclipse.jetty.websocket/websocket-server -->
        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>websocket-server</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
