<?xml version="1.0" encoding="UTF-8"?>
<!--
#
# Copyright (c) 2014-2016 NEC Corporation
# All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this
# distribution, and is available at http://www.eclipse.org/legal/epl-v10.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>org.opendaylight.vtn</groupId>
    <artifactId>manager.common</artifactId>
    <version>0.4.2-Beryllium-SR2</version>
    <relativePath>../common</relativePath>
  </parent>

  <groupId>org.opendaylight.vtn</groupId>
  <artifactId>features-vtn-manager</artifactId>
  <packaging>jar</packaging>

  <properties>
    <vtn.manager.dir>..</vtn.manager.dir>
    <features.file>features.xml</features.file>
  </properties>

  <profiles>
    <profile>
      <id>skip-features-test</id>
      <activation>
        <activeByDefault>false</activeByDefault>

        <!-- Skip features integration test if vtn.karaf.skip is true. -->
        <property>
          <name>vtn.karaf.skip</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <skipTests>true</skipTests>
      </properties>
    </profile>
  </profiles>

  <scm>
    <connection>scm:git:https://git.opendaylight.org/gerrit/p/vtn.git</connection>
    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/vtn.git</developerConnection>
    <url>https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:Main</url>
    <tag>HEAD</tag>
  </scm>

  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>karaf-maven-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>features-create-kar</id>
            <goals>
              <goal>features-create-kar</goal>
            </goals>
            <configuration>
              <featuresFile>${project.build.directory}/classes/${features.file}</featuresFile>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>filter</id>
            <goals>
              <goal>resources</goal>
            </goals>
            <phase>generate-resources</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
            <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
            <karaf.distro.version>${karaf.empty.version}</karaf.distro.version>
          </systemPropertyVariables>
          <dependenciesToScan>
            <dependency>org.opendaylight.odlparent:features-test</dependency>
          </dependenciesToScan>
        </configuration>
       </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.directory}/classes/${features.file}</file>
                  <type>xml</type>
                  <classifier>features</classifier>
                </artifact>
                <artifact>
                  <file>${project.build.directory}/${project.artifactId}-${project.version}.kar</file>
                  <type>kar</type>
                  <classifier>features</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <!-- bundle dependencies -->
    <dependency>
      <groupId>org.opendaylight.vtn</groupId>
      <artifactId>manager</artifactId>
    </dependency>

    <dependency>
      <groupId>org.opendaylight.vtn</groupId>
      <artifactId>manager.model</artifactId>
    </dependency>

    <dependency>
      <groupId>org.opendaylight.vtn</groupId>
      <artifactId>manager.implementation</artifactId>
    </dependency>

    <dependency>
      <groupId>org.opendaylight.vtn</groupId>
      <artifactId>manager.implementation</artifactId>
      <classifier>config</classifier>
      <type>xml</type>
    </dependency>

    <dependency>
      <groupId>org.opendaylight.vtn</groupId>
      <artifactId>manager.neutron</artifactId>
    </dependency>

    <dependency>
      <groupId>org.opendaylight.vtn</groupId>
      <artifactId>manager.neutron</artifactId>
      <classifier>config</classifier>
      <type>xml</type>
    </dependency>

    <!-- OpenDaylight controller -->
    <dependency>
      <groupId>org.opendaylight.controller</groupId>
      <artifactId>features-mdsal</artifactId>
      <classifier>features</classifier>
      <type>xml</type>
    </dependency>

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

    <!-- OpenDaylight netconf -->
    <dependency>
      <groupId>org.opendaylight.netconf</groupId>
      <artifactId>features-restconf</artifactId>
      <classifier>features</classifier>
      <type>xml</type>
    </dependency>

    <!-- OpenDaylight openflowplugin -->
    <dependency>
      <groupId>org.opendaylight.openflowplugin</groupId>
      <artifactId>features-openflowplugin</artifactId>
      <classifier>features</classifier>
      <type>xml</type>
    </dependency>

    <!-- OpenDaylight neutron -->
    <dependency>
      <groupId>org.opendaylight.neutron</groupId>
      <artifactId>dummyprovider</artifactId>
      <version>${odl.neutron.version}</version>
    </dependency>
    <dependency>
      <groupId>org.opendaylight.neutron</groupId>
      <artifactId>features-neutron</artifactId>
      <classifier>features</classifier>
      <type>xml</type>
    </dependency>

    <!-- OpenDaylight ovsdb -->
     <dependency>
      <groupId>org.opendaylight.ovsdb</groupId>
      <artifactId>southbound-features</artifactId>
      <classifier>features</classifier>
      <type>xml</type>
    </dependency>

    <!-- test to validate features.xml -->
    <dependency>
      <groupId>org.opendaylight.odlparent</groupId>
      <artifactId>features-test</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- dependency for opendaylight-karaf-empty for use by testing -->
    <dependency>
      <groupId>org.opendaylight.controller</groupId>
      <artifactId>opendaylight-karaf-empty</artifactId>
      <type>zip</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>
