<?xml version="1.0" encoding="UTF-8"?>
<!--

     Copyright 2005-2016 Red Hat, Inc.

     Red Hat licenses this file to you under the Apache License, version
     2.0 (the "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
     implied.  See the License for the specific language governing
     permissions and limitations under the License.

   -->
   <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>io.fabric8</groupId>
      <version>3.0.8</version>
      <artifactId>fabric8-karaf</artifactId>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>fabric8-karaf-itests</artifactId>
    <name>Fabric8 :: Karaf :: Tests</name>

    <properties>
      <karaf.version>4.0.7</karaf.version>
      <osgi.version>6.0.0</osgi.version>
      <pax.exam.version>4.9.1</pax.exam.version>
      <servlet.api.version>3.1.0</servlet.api.version>
      <validation.api.version>1.1.0.Final</validation.api.version>
    </properties>


    <dependencies>
      <dependency>
        <groupId>org.apache.aries.blueprint</groupId>
        <artifactId>org.apache.aries.blueprint.core</artifactId>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.compendium</artifactId>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-karaf-blueprint</artifactId>
        <version>${project.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-karaf-cm</artifactId>
        <version>${project.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.karaf.itests</groupId>
        <artifactId>itests</artifactId>
        <version>${karaf.version}</version>
        <type>test-jar</type>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.karaf</groupId>
        <artifactId>apache-karaf-minimal</artifactId>
        <version>${karaf.version}</version>
        <scope>test</scope>
        <type>tar.gz</type>
        <exclusions>
          <exclusion>
            <artifactId>org.apache.karaf.client</artifactId>
            <groupId>org.apache.karaf</groupId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-container-karaf</artifactId>
        <version>${pax.exam.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>pax-exam-junit4</artifactId>
        <version>${pax.exam.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-atinject_1.0_spec</artifactId>
        <version>1.0</version>
        <scope>test</scope>
      </dependency>
    </dependencies>

    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.servicemix.tooling</groupId>
          <artifactId>depends-maven-plugin</artifactId>
          <version>1.3</version>
          <executions>
            <execution>
              <id>generate-depends-file</id>
              <goals>
                <goal>generate-depends-file</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
            <execution>
              <id>copy-features-xml</id>
              <phase>process-test-resources</phase>
              <goals>
                <goal>copy</goal>
              </goals>
              <configuration>
                <artifactItems>
                  <artifactItem>
                    <groupId>io.fabric8</groupId>
                    <artifactId>fabric8-karaf-features</artifactId>
                    <version>${project.version}</version>
                    <classifier>features</classifier>
                    <type>xml</type>
                    <outputDirectory>${project.build.directory}/</outputDirectory>
                    <destFileName>features.xml</destFileName>
                  </artifactItem>
                </artifactItems>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.karaf.tooling</groupId>
          <artifactId>karaf-maven-plugin</artifactId>
          <version>${karaf.version}</version>
          <executions>
            <execution>
              <id>add-features-to-repo</id>
              <phase>process-test-resources</phase>
              <goals>
                <goal>features-add-to-repository</goal>
              </goals>
              <configuration>
                <features>
                  <feature>fabric8-karaf-blueprint</feature>
                </features>
                <descriptors>
                  <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>
                  <descriptor>file:${project.build.directory}/features.xml</descriptor>
                </descriptors>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <systemPropertyVariables>
              <features.xml>${project.build.directory}/features.xml</features.xml>
              <features.repo>${project.build.directory}/features-repo</features.repo>
              <fabric8.config.plugin.enabled>false</fabric8.config.plugin.enabled>
              <fabric8.cm.bridge.enabled>false</fabric8.cm.bridge.enabled>
            </systemPropertyVariables>
          </configuration>
        </plugin>
      </plugins>
    </build>

  </project>
