<?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">
    <parent>
        <artifactId>video</artifactId>
        <groupId>org.codice.alliance.video</groupId>
        <version>1.17.6</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>video-mpegts-stream</artifactId>
    <name>Alliance :: Video :: Stream</name>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>ddf.security.core</groupId>
            <artifactId>security-core-api</artifactId>
            <version>${ddf.version}</version>
        </dependency>

        <dependency>
            <groupId>ddf.security.core</groupId>
            <artifactId>security-core-services</artifactId>
            <version>${ddf.version}</version>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

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

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

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

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

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

        <dependency>
            <groupId>com.barchart.udt</groupId>
            <artifactId>barchart-udt-bundle</artifactId>
            <version>2.3.0</version>
        </dependency>

        <dependency>
            <groupId>org.jcodec</groupId>
            <artifactId>jcodec</artifactId>
            <version>${jcodec.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codice.ddf</groupId>
            <artifactId>klv</artifactId>
            <version>${ddf.version}</version>
            <exclusions>
                <exclusion>
                    <!-- This is already being pulled in by another dependency and causes classpath issues in unit tests -->
                    <groupId>org.opengis</groupId>
                    <artifactId>geoapi</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.codice.ddf</groupId>
            <artifactId>mpeg-transport-stream</artifactId>
            <version>${ddf.version}</version>
        </dependency>

        <dependency>
            <groupId>ddf.catalog.core</groupId>
            <artifactId>catalog-core-api</artifactId>
            <version>${ddf.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.catalog.core</groupId>
            <artifactId>catalog-core-api-impl</artifactId>
            <version>${ddf.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.platform.util</groupId>
            <artifactId>platform-util</artifactId>
            <version>${ddf.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codice.alliance</groupId>
            <artifactId>stanag4609</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codice.alliance</groupId>
            <artifactId>mpegts</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codice.alliance</groupId>
            <artifactId>klv</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons-collections4.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codice.alliance.video</groupId>
            <artifactId>video-security</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codice.alliance.catalog.core</groupId>
            <artifactId>catalog-core-classification-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.catalog.core</groupId>
            <artifactId>filter-proxy</artifactId>
            <version>${ddf.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.platform.util</groupId>
            <artifactId>util-uuidgenerator-api</artifactId>
            <version>${ddf.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.failsafe</groupId>
            <artifactId>failsafe</artifactId>
            <version>${dev.failsafe.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <version>1.16.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-api</artifactId>
            <version>${geotools.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Import-Package>
                            org.opengis.annotation.*;resolution:=optional,
                            org.opengis.*,
                            <!-- TODO: Don't embed netty dependencies. Maintaining this optional
                                 import list is a pain -->
                            <!-- BEGIN: Optional packages taken from the embedded netty
                                 dependencies. This is the union of all optional packages of the
                                 embeds minus those actually used by this bundle -->
                            com.google.protobuf;resolution:=optional,
                            com.google.protobuf.nano;resolution:=optional,
                            com.jcraft.jzlib;resolution:=optional,
                            com.ning.compress;resolution:=optional,
                            com.ning.compress.lzf;resolution:=optional,
                            com.ning.compress.lzf.util;resolution:=optional,
                            com.oracle.svm.core.annotate;resolution:=optional,
                            javax.security.cert;resolution:=optional,
                            lzma.sdk;resolution:=optional,
                            lzma.sdk.lzma;resolution:=optional,
                            net.jpountz.lz4;resolution:=optional,
                            net.jpountz.xxhash;resolution:=optional,
                            org.apache.commons.logging;resolution:=optional,
                            org.apache.log4j;resolution:=optional,
                            org.apache.logging.log4j;resolution:=optional,
                            org.apache.logging.log4j.message;resolution:=optional,
                            org.apache.logging.log4j.spi;resolution:=optional,
                            org.jboss.marshalling;resolution:=optional,
                            org.slf4j.helpers;resolution:=optional,
                            org.slf4j.spi;resolution:=optional,
                            reactor.blockhound;resolution:=optional,
                            reactor.blockhound.integration;resolution:=optional,
                            sun.misc;resolution:=optional,
                            sun.nio.ch;resolution:=optional,
                            org.eclipse.jetty.npn;resolution:=optional,
                            org.eclipse.jetty.alpn;resolution:=optional,
                            <!-- END -->
                            *
                        </Import-Package>
                        <Embed-Dependency>
                            netty-buffer,
                            netty-codec,
                            netty-common,
                            netty-resolver,
                            netty-transport,
                            barchart-udt-bundle,
                            jcodec,
                            catalog-core-api-impl,
                            commons-lang3,
                            commons-collections4
                        </Embed-Dependency>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/classes</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </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>
                                    <limits>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.78</minimum>
                                        </limit>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.70</minimum>
                                        </limit>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.66</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
