<?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>
    <parent>
        <groupId>org.zalando</groupId>
        <artifactId>logbook-parent</artifactId>
        <version>4.0.2</version>
        <relativePath>../logbook-parent/pom.xml</relativePath>
    </parent>
    <artifactId>logbook-core</artifactId>
    <name>${project.artifactId}</name>
    <description>HTTP request and response logging</description>
    <scm>
        <url>https://github.com/zalando/logbook</url>
        <connection>scm:git:git@github.com:zalando/logbook.git</connection>
        <developerConnection>scm:git:git@github.com:zalando/logbook.git</developerConnection>
    </scm>
    <dependencies>
        <dependency>
            <groupId>org.zalando</groupId>
            <artifactId>logbook-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.zalando</groupId>
            <artifactId>logbook-common</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>tools.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson3.version}</version>
            <optional>true</optional>
        </dependency>
        <!-- testing -->
        <dependency>
            <groupId>org.zalando</groupId>
            <artifactId>logbook-test</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <!-- This is a workaround to having module names before switching to Java 9+ -->
                            <!-- It will set our desired Automatic-Module-Name inside META/INF/MANIFEST.MF file -->
                            <Automatic-Module-Name>org.zalando.logbook.core</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>check</id>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>CLASS</element>
                                    <excludes>
                                        <!-- Jackson 3 extractors are excluded because Jackson 2 and Jackson 3 cannot coexist on the test classpath due to annotation conflicts -->
                                        <exclude>org.zalando.logbook.core.attributes.JwtClaimsExtractor</exclude>
                                        <exclude>org.zalando.logbook.core.attributes.JwtFirstMatchingClaimExtractor</exclude>
                                        <exclude>org.zalando.logbook.core.attributes.JwtAllMatchingClaimsExtractor</exclude>
                                    </excludes>
                                    <limits>
                                        <limit>
                                            <counter>LINE</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>1.0</minimum>
                                        </limit>
                                        <limit>
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>1.0</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
