<?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">

    <parent>
        <groupId>org.opendaylight.odlparent</groupId>
        <artifactId>karaf4-parent</artifactId>
        <version>9.0.13</version>
        <relativePath/>
    </parent>

    <groupId>org.opendaylight.integration</groupId>
    <artifactId>onap-karaf</artifactId>
    <version>0.15.2</version>
    <packaging>pom</packaging>
    <name>ODL :: integration :: ${project.artifactId}</name>
    <modelVersion>4.0.0</modelVersion>

    <description>The ONAP Karaf distribution.</description>
    <url>https://wiki.opendaylight.org/x/ggYF</url>
    <licenses>
        <license>
            <name>Eclipse Public License v1.0</name>
            <url>http://www.eclipse.org/legal/epl-v10.html</url>
        </license>
    </licenses>

    <properties>
        <karaf.archiveZip>false</karaf.archiveZip>
        <karaf.archiveTarGz>true</karaf.archiveTarGz>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.opendaylight.integration</groupId>
                <artifactId>all-artifacts</artifactId>
                <version>${project.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- AAA -->
        <dependency>
            <groupId>org.opendaylight.aaa</groupId>
            <artifactId>features-aaa</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>

        <!-- Controller -->
        <dependency>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>features-controller</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.controller</groupId>
            <artifactId>features-controller-experimental</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>

        <!-- Daexim -->
        <dependency>
            <groupId>org.opendaylight.daexim</groupId>
            <artifactId>daexim-features</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>

        <!-- MD-SAL -->
        <dependency>
            <groupId>org.opendaylight.mdsal</groupId>
            <artifactId>features-mdsal</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>

        <!-- Netconf -->
        <dependency>
            <groupId>org.opendaylight.netconf</groupId>
            <artifactId>features-netconf</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.netconf</groupId>
            <artifactId>features-netconf-connector</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.netconf</groupId>
            <artifactId>features-restconf</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.netconf</groupId>
            <artifactId>features-yanglib</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>

        <!--ODL Parent-->
        <dependency>
            <groupId>org.opendaylight.odlparent</groupId>
            <artifactId>features-odlparent</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.opendaylight.aaa</groupId>
            <artifactId>aaa-cli-jar</artifactId>
            <!-- This scope test here is just a trick, so that we can use aaa-cli-jar in maven-dependency-plugin, but don't have karaf-maven-plugin choke on it -->
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.integration</groupId>
            <artifactId>karaf-scripts</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-aaa-cli-jar</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/assembly/bin</outputDirectory>
                            <includeArtifactIds>aaa-cli-jar</includeArtifactIds>
                            <overWriteReleases>true</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                            <excludeTransitive>true</excludeTransitive>
                            <!-- Do not include version in JAR filename, as external scripts call this utility,
                                 and they understandly do not want to have to adjust for every ODL release;
                                 see e.g. https://github.com/dfarrell07/puppet-opendaylight/pull/140 -->
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-odl-karaf-resources</id>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <phase>prepare-package</phase>
                        <configuration>
                            <outputDirectory>${project.build.directory}/assembly</outputDirectory>
                            <groupId>org.opendaylight.integration</groupId>
                            <includeArtifactIds>karaf-scripts</includeArtifactIds>
                            <excludes>META-INF\/**</excludes>
                            <excludeTransitive>true</excludeTransitive>
                            <ignorePermissions>false</ignorePermissions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
