<?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>8.1.8</version>
    <relativePath/>
  </parent>

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

  <properties>
    <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>

    <!-- FIXME: Remove this -->
    <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>controller-artifacts</artifactId>
        <version>3.0.15</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.opendaylight.controller</groupId>
      <artifactId>mdsal-it-base</artifactId>
    </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>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-extender-service</artifactId>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-inject</artifactId>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-invoker-junit</artifactId>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.url</groupId>
        <artifactId>pax-url-aether</artifactId>
    </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>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>
              <!-- Overridden to have TCP channel support -->
          <version>3.0.0-M5</version>
          <configuration>
              <!-- Overridden to fix corruption, where the process would hang after test -->
              <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
              <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>
