<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>zeppelin</artifactId>
    <groupId>org.apache.zeppelin</groupId>
    <version>0.12.1</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>zeppelin-integration</artifactId>
  <packaging>jar</packaging>
  <name>Zeppelin: Integration Test</name>

  <!-- See https://github.com/eirslett/frontend-maven-plugin/issues/229 -->
  <prerequisites>
    <maven>3.1.0</maven>
  </prerequisites>

  <properties>
    <!--test library versions-->
    <selenium.java.version>4.20.0</selenium.java.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>${gson.version}</version>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>${selenium.java.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.rauschig</groupId>
      <artifactId>jarchivelib</artifactId>
      <version>0.7.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-compress</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>zeppelin-zengine</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>spark-interpreter</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-shell</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-angular</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-jdbc</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-markdown</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-python</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-web</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-server</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-server</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
      <classifier>tests</classifier>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-zengine</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
      <classifier>tests</classifier>
    </dependency>
    <dependency>
      <groupId>org.apache.zeppelin</groupId>
      <artifactId>zeppelin-test</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <!--test libraries-->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <argLine>-Xmx2048m</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration combine.children="append">
          <argLine>-Xmx2g -Xms1g -Dfile.encoding=UTF-8</argLine>
          <excludes>
            <exclude>${tests.to.exclude}</exclude>
          </excludes>
          <environmentVariables>
            <ZEPPELIN_FORCE_STOP>1</ZEPPELIN_FORCE_STOP>
          </environmentVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-dependency-convergence</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>using-source-tree</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <zeppelin.daemon.package.base>
          ../bin
        </zeppelin.daemon.package.base>
      </properties>
    </profile>
    <profile>
      <id>using-packaged-distr</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <zeppelin.daemon.package.base>
          ../zeppelin-distribution/target/zeppelin-${project.version}-bin/zeppelin-${project.version}-bin/bin
        </zeppelin.daemon.package.base>
      </properties>
    </profile>
    <!-- Include some test dependencies depending on the spark-scala profile -->
    <profile>
      <id>spark-scala-2.13</id>
      <dependencies>
        <dependency>
          <groupId>org.apache.zeppelin</groupId>
          <artifactId>spark-scala-2.13</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>spark-scala-2.12</id>
      <dependencies>
        <dependency>
          <groupId>org.apache.zeppelin</groupId>
          <artifactId>spark-scala-2.12</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

</project>
