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

    Copyright (c) 2019 Red Hat, Inc.
    This program and the accompanying materials are made
    available under the terms of the Eclipse Public License 2.0
    which is available at:

        https://www.eclipse.org/legal/epl-2.0/

    SPDX-License-Identifier: EPL-2.0

    Contributors:
      Red Hat, Inc. - initial API and implementation

-->
<!--
Use

mvn clean install -Dinvoker.test=<directory of single test>

for running a single test.
-->
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.eclipse.jkube</groupId>
    <artifactId>openshift-maven-plugin-parent</artifactId>
    <version>1.1.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>openshift-maven-plugin-it</artifactId>
  <packaging>jar</packaging>

  <name>OpenShift Maven Plugin :: Integration Tests</name>

  <properties>
    <jkube.version>${project.version}</jkube.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>${version.jackson}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>${version.jackson}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <version>${version.jackson}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.consol.citrus</groupId>
      <artifactId>citrus-core</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Disable dependencyConvergence -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>dependency-convergence</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration combine.self="override">
              <rules></rules>
              <skip>true</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <configuration>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <cloneClean>true</cloneClean>
          <!--<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>-->
          <settingsFile>src/it/settings.xml</settingsFile>
          <postBuildHookScript>verify</postBuildHookScript>
          <addTestClassPath>true</addTestClassPath>
          <skipInvocation>${skipTests}</skipInvocation>
          <streamLogs>true</streamLogs>
          <invokerPropertiesFile>invoker.properties</invokerPropertiesFile>
          <scriptVariables>
            <version>${project.version}</version>
            <artifactId>${project.artifactId}</artifactId>
            <groupId>${project.groupId}</groupId>
          </scriptVariables>
        </configuration>
        <executions>
          <execution>
            <id>integration-tests</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
