<?xml version="1.0"?>
<!--
/**
 * 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.test.itests</groupId>
        <artifactId>itests</artifactId>
        <version>2.30.1</version>
    </parent>
    <artifactId>test-itests-common</artifactId>
    <name>DDF :: Integration Test :: Common</name>
    <packaging>bundle</packaging>

    <properties>
        <!-- For maven-surefire-plugin -->
        <surefire.argline.append>-Dddf.version=${project.version}</surefire.argline.append>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-link-mvn</artifactId>
            <version>${pax.exam.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.url</groupId>
            <artifactId>pax-url-wrap</artifactId>
            <version>${pax.url.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.classic.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.cmpn</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.itests</groupId>
            <artifactId>common</artifactId>
            <version>${karaf.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>${commons-lang.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-native</artifactId>
            <version>${pax.exam.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>dev.failsafe</groupId>
            <artifactId>failsafe</artifactId>
            <version>${dev.failsafe.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.thirdparty</groupId>
            <artifactId>restito</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.grizzly</groupId>
            <artifactId>grizzly-http-server</artifactId>
            <version>2.3.25</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-karaf</artifactId>
        </dependency>
        <dependency>
            <groupId>ddf.admin.core</groupId>
            <artifactId>admin-core-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.admin.core</groupId>
            <artifactId>admin-core-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.platform.util</groupId>
            <artifactId>platform-util</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>ddf.catalog.core</groupId>
            <artifactId>catalog-core-api-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
        </dependency>
        <dependency>
            <groupId>ddf.lib</groupId>
            <artifactId>test-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.security.core</groupId>
            <artifactId>security-core-services</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ddf.security.core</groupId>
            <artifactId>security-core-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>net.minidev</groupId>
                <artifactId>json-smart</artifactId>
                <version>${json-smart.version}</version>
            </dependency>
            <dependency>
                <groupId>org.ops4j.base</groupId>
                <artifactId>ops4j-base-util-property</artifactId>
                <version>${org.ops4j.base.version}</version>
            </dependency>
            <dependency>
                <groupId>org.ops4j.base</groupId>
                <artifactId>ops4j-base-net</artifactId>
                <version>${org.ops4j.base.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <configuration>
                  <excludes>**/WFS*.xml,**/sfRoad*.xml,src/main/resources/tika/**</excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>
                            ${project.groupId}.${project.artifactId}
                        </Bundle-SymbolicName>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Import-Package>
                            ddf.security,
                            org.junit.*,
                            org.hamcrest.*;version=1.3,
                            org.awaitility.*,
                            com.google.common.*,
                            io.restassured.*;version=3.3.0,
                            org.apache.commons.*;
                            *;resolution:=optional
                        </Import-Package>
                        <Export-Package>
                            org.codice.ddf.itests.common.*
                        </Export-Package>
                        <Embed-Dependency>
                            admin-core-impl,
                            catalog-core-api-impl,
                            common,
                            pax-exam-container-karaf,
                            security-core-services
                        </Embed-Dependency>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!--exclude karaf container for PaxExamRuleTest, there can only be one container present (Should be using NativeTestContainerFactory)-->
                    <classpathDependencyExcludes>
                        <classpathDependencyExclude>org.ops4j.pax.exam:pax-exam-container-karaf
                        </classpathDependencyExclude>
                    </classpathDependencyExcludes>
                </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>7.7_MB</maxArtifactSize>
                                </ArtifactSizeEnforcerRule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
