<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=4 tabstop=4: -->
<!--
Copyright (c) 2014 Cisco Systems, Inc. and others.  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.odlparent</groupId>
    <artifactId>bundle-parent</artifactId>
    <version>3.1.6</version>
    <relativePath/>
  </parent>

  <groupId>org.opendaylight.controller</groupId>
  <artifactId>mdsal-it-parent</artifactId>
  <version>1.8.2</version>
  <packaging>pom</packaging>

  <properties>
    <mdsal.version>1.8.2</mdsal.version>
    <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
    <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
    <karaf.distro.type>zip</karaf.distro.type>
    <karaf.keep.unpack>false</karaf.keep.unpack>
  </properties>

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

  <dependencies>
    <dependency>
      <groupId>org.opendaylight.controller</groupId>
      <artifactId>mdsal-it-base</artifactId>
      <version>${mdsal.version}</version>
    </dependency>

    <!-- Dependencies for pax exam karaf container -->
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-container-karaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-junit4</artifactId>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam</artifactId>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-features</artifactId>
        <type>xml</type>

        <!-- FIXME: remove version declaration and scope once odlparent has this -->
        <version>${exam.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-extender-service</artifactId>

        <!-- FIXME: remove version declaration and scope once odlparent has this -->
        <version>${exam.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-inject</artifactId>

        <!-- FIXME: remove version declaration and scope once odlparent has this -->
        <version>${exam.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-invoker-junit</artifactId>

        <!-- FIXME: remove version declaration and scope once odlparent has this -->
        <version>${exam.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.ops4j.pax.url</groupId>
        <artifactId>pax-url-aether</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.karaf.features</groupId>
        <artifactId>org.apache.karaf.features.core</artifactId>
        <version>${karaf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
    </dependency>

    <!-- Testing Dependencies -->
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
              <systemPropertyVariables>
                <!-- CONTROLLER-1799: Use the same repository for Pax Exam as is used for Maven -->
                <org.ops4j.pax.url.mvn.localRepository>${settings.localRepository}</org.ops4j.pax.url.mvn.localRepository>
              </systemPropertyVariables>
          </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <systemProperties>
                <property>
                 <name>karaf.distro.groupId</name>
                 <value>${karaf.distro.groupId}</value>
                </property>
                <property>
                 <name>karaf.distro.artifactId</name>
                 <value>${karaf.distro.artifactId}</value>
                </property>
                <property>
                 <name>karaf.distro.version</name>
                 <value>${karaf.distro.version}</value>
                </property>
                <property>
                 <name>karaf.distro.type</name>
                 <value>${karaf.distro.type}</value>
                </property>
                <property>
                 <name>karaf.keep.unpack</name>
                 <value>${karaf.keep.unpack}</value>
                </property>
              </systemProperties>
              <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Needed if you use versionAsInProject() -->
      <plugin>
          <groupId>org.apache.servicemix.tooling</groupId>
          <artifactId>depends-maven-plugin</artifactId>
          <executions>
              <execution>
                  <id>generate-depends-file</id>
                  <goals>
                      <goal>generate-depends-file</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>

      <!-- Copy the Base Test classes into test-classes so they can become available in the karaf container -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
           <id>unpack-karaf-resources</id>
           <goals>
            <goal>unpack-dependencies</goal>
           </goals>
           <phase>process-test-resources</phase>
           <configuration>
            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
            <groupId>org.opendaylight.controller</groupId>
            <includeArtifactIds>mockito-core,objenesis,mdsal-it-base</includeArtifactIds>
            <excludes>META-INF\/**</excludes>
            <ignorePermissions>false</ignorePermissions>
           </configuration>
          </execution>
         </executions>
      </plugin>
    </plugins>
  </build>
</project>
