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

  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF 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">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.plc4x</groupId>
    <artifactId>karaf-features</artifactId>
    <version>0.6.0</version>
  </parent>

  <artifactId>karaf-itest</artifactId>

  <name>PLC4J: Karaf-Features: Integration-Tests</name>

  <properties>
    <karaf.version>4.2.6</karaf.version>
    <pax.version>4.13.1</pax.version>
  </properties>

  <dependencies>
    <!-- Important, have a dependency on the feature maven module that its built first -->
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>driver-s7-feature</artifactId>
      <version>0.6.0</version>
      <classifier>features</classifier>
      <type>xml</type>
    </dependency>
    <!-- Provide the KarafTestSupport -->
    <dependency>
      <groupId>org.apache.karaf.itests</groupId>
      <artifactId>common</artifactId>
      <version>${karaf.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- Define the Apache Karaf version to download and use for the test -->
    <!-- We use a released version here to avoid SNAPSHOT resolution -->
    <dependency>
      <groupId>org.apache.karaf</groupId>
      <artifactId>apache-karaf</artifactId>
      <version>${karaf.version}</version>
      <scope>test</scope>
      <type>tar.gz</type>
    </dependency>

    <!-- Add the surefire logger api as failsafe doesn't provide this -->
    <dependency>
      <groupId>org.apache.maven.surefire</groupId>
      <artifactId>surefire-logger-api</artifactId>
      <version>${surefire.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.26</version>
      <scope>test</scope>
    </dependency>
    <!-- Required to use shell commands in the tests -->
    <dependency>
      <groupId>org.apache.karaf.shell</groupId>
      <artifactId>org.apache.karaf.shell.core</artifactId>
      <version>${karaf.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- Provide the PaxExam Karaf support -->
    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-container-karaf</artifactId>
      <version>${pax.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- Provide the PaxExam JUnit extension -->
    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-junit4</artifactId>
      <version>${pax.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-atinject_1.0_spec</artifactId>
      <version>1.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>3.1.6</version>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.bundles</groupId>
      <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
      <version>1.3_1</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4j-api</artifactId>
      <version>0.6.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.servicemix.tooling</groupId>
        <artifactId>depends-maven-plugin</artifactId>
        <version>1.4.0</version>
        <executions>
          <execution>
            <id>generate-depends-file</id>
            <goals>
              <goal>generate-depends-file</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- See https://issues.apache.org/jira/browse/KARAF-6457 -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <forkCount>1</forkCount>
          <reuseForks>false</reuseForks>
          <systemPropertyVariables>
            <org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
            <spring31.version>3.1.4.RELEASE</spring31.version>
            <spring32.version>3.2.18.RELEASE_1</spring32.version>
            <spring40.version>4.0.9.RELEASE_1</spring40.version>
            <spring41.version>4.1.9.RELEASE_1</spring41.version>
            <spring42.version>4.2.9.RELEASE_1</spring42.version>
            <spring43.version>4.3.25.RELEASE_1</spring43.version>
            <spring50.version>5.0.15.RELEASE_1</spring50.version>
            <spring51.version>5.1.9.RELEASE_1</spring51.version>
            <spring.security31.version>3.1.4.RELEASE</spring.security31.version>
            <spring.security42.version>4.2.4.RELEASE_1</spring.security42.version>
            <spring.security51.version>5.1.5.RELEASE_1</spring.security51.version>
            <activemq.version>5.15.9</activemq.version>
            <plc4x.version>${project.version}</plc4x.version>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <!-- Karaf currently doesn't work with Java 12 and above -->
  <!-- See: https://issues.apache.org/jira/projects/KARAF/issues/KARAF-6203 -->
  <profiles>
    <profile>
      <id>java12andAbove</id>
      <activation>
        <jdk>(12,]</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>