<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2017 ABSA Group Limited
  ~
  ~ Licensed 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>
    <artifactId>examples</artifactId>
    <packaging>jar</packaging>

    <parent>
        <groupId>za.co.absa.spline</groupId>
        <artifactId>parent</artifactId>
        <relativePath>../parent/pom.xml</relativePath>
        <version>0.4.0</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.compat.version}</artifactId>
            <version>${spark.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.compat.version}</artifactId>
            <version>${spark.version}</version>
        </dependency>
        <dependency>
            <groupId>com.databricks</groupId>
            <artifactId>spark-xml_${scala.compat.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>za.co.absa.spline</groupId>
            <artifactId>spark-agent</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>license-check</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.rat</groupId>
                        <artifactId>apache-rat-plugin</artifactId>
                        <configuration>
                            <excludes combine.children="append">
                                <exclude>data/**</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>examples</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.8</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <property name="compile_classpath" refid="maven.compile.classpath" />
                                        <ant antfile="${basedir}/run-example.xml">
                                            <target name="main" />
                                        </ant>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>ant-contrib</groupId>
                                <artifactId>ant-contrib</artifactId>
                                <version>1.0b3</version>
                                <exclusions>
                                    <exclusion>
                                        <artifactId>ant</artifactId>
                                        <groupId>ant</groupId>
                                    </exclusion>
                                </exclusions>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
