<?xml version="1.0" encoding="UTF-8"?>
<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>
        <artifactId>sansa-owl-parent_2.11</artifactId>
        <groupId>net.sansa-stack</groupId>
        <version>0.3.0</version>
    </parent>

    <artifactId>sansa-owl-flink_2.11</artifactId>
    <version>0.3.0</version>

    <name>SANSA OWL layer - Flink</name>
    <description>A library to read OWL files into Flink.</description>

    <dependencies>
        <dependency>
            <groupId>net.sansa-stack</groupId>
            <artifactId>sansa-owl-common_${scala.binary.version}</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Scala dependencies -->
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
        </dependency>

        <!-- Apache Flink dependencies -->
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-scala_2.11</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-clients_2.11</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-hadoop-compatibility_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>de.javakaffee</groupId>
            <artifactId>kryo-serializers</artifactId>
        </dependency>

        <!-- OWL API dependencies -->
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-api</artifactId>
        </dependency>

        <!-- Testing dependencies -->
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.binary.version}</artifactId>
        </dependency>
        
        <!-- Logging dependencies -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>build-jar</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-scala_2.11</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.flink</groupId>
                    <artifactId>flink-clients_2.11</artifactId>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>dist</id>
            <activation>
                <property>
                    <name>dist</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>2.4.3</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <artifactSet>
                                        <excludes>
                                            <exclude>com.data-artisans:flakka-actor</exclude>
                                            <exclude>com.data-artisans:flakka-remote_2.11</exclude>
                                            <exclude>com.data-artisans:flakka-slf4j_2.11</exclude>
                                            <exclude>com.esotericsoftware.kryo:kryo</exclude>
                                            <exclude>com.esotericsoftware.minlog:minlog</exclude>
                                            <exclude>com.fasterxml.jackson.core:jackson*</exclude>
                                            <exclude>com.github.scopt:scopt_2.11</exclude>
                                            <exclude>com.google.code.findbugs:jsr305</exclude>
                                            <exclude>com.google.protobuf:protobuf-java</exclude>
                                            <exclude>com.jamesmurty.utils:java-xmlbuilder</exclude>
                                            <exclude>com.jcraft:jsch</exclude>
                                            <exclude>com.sun.jersey:jersey-core</exclude>
                                            <exclude>com.thoughtworks.paranamer:paranamer</exclude>
                                            <exclude>com.typesafe:config</exclude>
                                            <exclude>com.twitter:chill_2.11</exclude>
                                            <exclude>com.twitter:com.twitter:chill-java</exclude>
                                            <exclude>commons-beanutils:commons-beanutils-bean-collections</exclude>
                                            <exclude>commons-cli:commons-cli</exclude>
                                            <exclude>commons-codec:commons-codec</exclude>
                                            <exclude>commons-configuration:commons-configuration</exclude>
                                            <exclude>commons-daemon:commons-daemon</exclude>
                                            <exclude>commons-digester:commons-digester</exclude>
                                            <exclude>commons-el:commons-el</exclude>
                                            <exclude>commons-lang:commons-lang</exclude>
                                            <exclude>commons-logging:commons-logging</exclude>
                                            <exclude>commons-net:commons-net</exclude>
                                            <exclude>commons-collections:commons-collections</exclude>
                                            <exclude>io.netty:netty*</exclude>
                                            <exclude>javax.activation:activation</exclude>
                                            <exclude>javax.servlet:servlet-api</exclude>
                                            <exclude>javax.xml.bind:jaxb-api</exclude>
                                            <exclude>javax.xml.stream:stax-api</exclude>
                                            <exclude>jline:jline</exclude>
                                            <exclude>junit:junit</exclude>
                                            <exclude>org.apache.avro:avro</exclude>
                                            <exclude>org.apache.commons:commons-compress</exclude>
                                            <exclude>org.apache.commons:commons-lang3</exclude>
                                            <exclude>org.apache.commons:commons-math3</exclude>
                                            <exclude>org.apache.flink:*</exclude>
                                            <exclude>org.apache.zookeeper:zookeeper</exclude>
                                            <exclude>org.clapper:grizzled-slf4j_2.11</exclude>
                                            <exclude>org.codehaus.jackson:jackson-*</exclude>
                                            <exclude>org.javassist:javassist</exclude>
                                            <exclude>org.mortbay.jetty:jetty-util</exclude>
                                            <exclude>org.objenesis:objenesis</exclude>
                                            <exclude>org.scala-lang:*</exclude>
                                            <exclude>org.uncommons.maths:uncommons-maths</exclude>
                                            <exclude>xmlenc:xmlenc</exclude>
                                        </excludes>
                                    </artifactSet>
                                    <filters>
                                        <filter>
                                            <artifact>*:*</artifact>
                                            <excludes>
                                                <exclude>META-INF/*.SF</exclude>
                                                <exclude>META-INF/*.DSA</exclude>
                                                <exclude>META-INF/*.RSA</exclude>
                                            </excludes>
                                        </filter>
                                    </filters>
                                    <createDependencyReducedPom>false</createDependencyReducedPom>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
