<?xml version="1.0" encoding="UTF-8"?>
<!-- /**
 * Copyright (c) Codice Foundation
 *
 * This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License is distributed along with this program and can be found at
 * <http://www.gnu.org/licenses/lgpl.html>.
 *
 **/ -->
<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>ddf.catalog.transformer</groupId>
        <artifactId>transformer</artifactId>
        <version>2.31.0</version>
    </parent>

    <name>DDF :: Catalog :: Transformer :: PDF</name>
    <artifactId>catalog-transformer-pdf</artifactId>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>ddf.catalog.core</groupId>
            <artifactId>catalog-core-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ddf.catalog.core</groupId>
            <artifactId>catalog-core-api-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>ddf.platform.util</groupId>
            <artifactId>platform-util</artifactId>
        </dependency>
        <dependency>
            <groupId>ddf.catalog.transformer</groupId>
            <artifactId>catalog-transformer-common</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcjmail-jdk18on</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcpkix-jdk18on</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcmail-jdk18on</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--External dependencies-->
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>${pdfbox.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>fontbox</artifactId>
            <version>${pdfbox.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox-tools</artifactId>
            <version>${pdfbox.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
            <version>${bouncy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcmail-jdk18on</artifactId>
            <version>${bouncy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk18on</artifactId>
            <version>${bouncy.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tika</groupId>
            <artifactId>tika-parsers</artifactId>
            <type>pom</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
            <!-- bug between new tika and old compress from karaf -->
            <!-- https://issues.apache.org/jira/si/jira.issueviews:issue-html/TIKA-4469/TIKA-4469.html -->
            <version>${commons-compress.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Import-Package>
                            !com.ibm.icu.text,
                            !org.apache.pdfbox.debugger.*,
                            sun.java2d.cmm.kcms;resolution:=optional,
                            picocli;resolution:=optional,
                            sun.print;resolution:=optional,
                            *
                        </Import-Package>
                        <Embed-Dependency>
                            catalog-core-api-impl,
                            catalog-transformer-common,
                            <!-- external -->
                            commons-lang3,
                            fontbox,
                            pdfbox,pdfbox-tools
                        </Embed-Dependency>
                        <Export-Package />
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>check-artifact-size</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <ArtifactSizeEnforcerRule implementation="org.codice.maven.artifactsize.ArtifactSizeEnforcerRule">
                                    <maxArtifactSize>4.8_MB</maxArtifactSize>
                                </ArtifactSizeEnforcerRule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <haltOnFailure>true</haltOnFailure>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <!-- Some limits had to be lowered because the code being tested
                                         uses try-with-resources, which generates branches that
                                         can't be fully tested yet are included in JaCoCo's branch
                                         count. See https://github.com/jacoco/jacoco/issues/82 -->
                                    <limits>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.74</minimum>
                                        </limit>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.52</minimum>
                                        </limit>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.48</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
