<?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.4.0</version>
    </parent>

    <artifactId>sansa-owl-flink_2.11</artifactId>
    <version>0.4.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>

            <plugin>
                <groupId>org.scalastyle</groupId>
                <artifactId>scalastyle-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.esotericsoftware:kryo</exclude>
                                            <exclude>com.esotericsoftware:minlog</exclude>
                                            <exclude>com.esotericsoftware:reflectasm</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.jamesmurty.utils:java-xmlbuilder</exclude>
                                            <exclude>com.jcraft:jsch</exclude>
                                            <exclude>com.sun.jersey:jersey-client</exclude>
                                            <exclude>com.thoughtworks.paranamer:paranamer</exclude>
                                            <exclude>com.twitter:chill_2.11</exclude>
                                            <exclude>com.twitter:chill-java</exclude>
                                            <exclude>com.typesafe.akka:akka-actor_2.11</exclude>
                                            <exclude>com.typesafe.akka:akka-protobuf_2.11</exclude>
                                            <exclude>com.typesafe.akka:akka-slf4j_2.11</exclude>
                                            <exclude>com.typesafe.akka:akka-stream_2.11</exclude>
                                            <exclude>com.typesafe:config</exclude>
                                            <exclude>com.typesafe:ssl-config-core_2.11</exclude>
                                            <exclude>commons-beanutils:commons-beanutils</exclude>
                                            <exclude>commons-cli:commons-cli</exclude>
                                            <exclude>commons-codec:commons-codec</exclude>
                                            <exclude>commons-collections:commons-collections</exclude>
                                            <exclude>commons-configuration:commons-configuration</exclude>
                                            <exclude>commons-daemon:commons-daemon</exclude>
                                            <exclude>commons-digester:commons-digester</exclude>
                                            <exclude>commons-io:commons-io</exclude>
                                            <exclude>commons-lang:commons-lang</exclude>
                                            <exclude>commons-logging:commons-logging</exclude>
                                            <exclude>commons-net:commons-net</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>org.apache.avro:avro</exclude>
                                            <exclude>org.apache.commons:commons-lang3</exclude>
                                            <exclude>org.apache.commons:commons-math3</exclude>
                                            <exclude>org.apache.commons:commons-compress</exclude>
                                            <exclude>org.apache.flink:flink-annotations</exclude>
                                            <exclude>org.apache.flink:flink-avro_2.11</exclude>
                                            <exclude>org.apache.flink:flink-clients_2.11</exclude>
                                            <exclude>org.apache.flink:flink-core_2.11</exclude>
                                            <exclude>org.apache.flink:flink-core</exclude>
                                            <exclude>org.apache.flink:flink-hadoop-fs</exclude>
                                            <exclude>org.apache.flink:flink-java*</exclude>
                                            <exclude>org.apache.flink:flink-java_2.11</exclude>
                                            <exclude>org.apache.flink:flink-metrics-core</exclude>
                                            <exclude>org.apache.flink:flink-optimizer_2.11</exclude>
                                            <exclude>org.apache.flink:flink-queryable-state-client-java_2.11</exclude>
                                            <exclude>org.apache.flink:flink-runtime_2.11</exclude>
                                            <exclude>org.apache.flink:flink-scala_2.11</exclude>
                                            <exclude>org.apache.flink:flink-shaded-asm</exclude>
                                            <exclude>org.apache.flink:flink-shaded-guava</exclude>
                                            <exclude>org.apache.flink:flink-shaded-hadoop2</exclude>
                                            <exclude>org.apache.flink:flink-shaded-jackson</exclude>
                                            <exclude>org.apache.flink:flink-shaded-netty</exclude>
                                            <exclude>org.apache.flink:flink-java-examples_2.11</exclude>
                                            <exclude>org.apache.flink:flink-scala-examples_2.11</exclude>
                                            <exclude>org.apache.flink:flink-streaming-examples_2.11</exclude>
                                            <exclude>org.apache.flink:flink-streaming-java_2.11</exclude>
                                            <exclude>org.apache.flink:force-shading</exclude>
                                            <exclude>org.apache.httpcomponents:*</exclude>
                                            <exclude>org.apache.zookeeper:zookeeper</exclude>
                                            <exclude>org.clapper:grizzled-slf4j_2.11</exclude>
                                            <exclude>org.codehaus.jackson:jackson-core-asl</exclude>
                                            <exclude>org.codehaus.jackson:jackson-mapper-asl</exclude>
                                            <exclude>org.javassist:javassist</exclude>
                                            <exclude>org.objenesis:objenesis</exclude>
                                            <exclude>org.scala-lang:*</exclude>
                                            <exclude>org.scala-lang.modules:scala-parser-combinators_2.11</exclude>
                                            <exclude>org.scala-lang.modules:scala-java8-compat_2.11</exclude>
                                            <exclude>org.scala-lang.modules:scala-xml_2.11</exclude>
                                            <exclude>org.slf4j:slf4j-api</exclude>
                                            <exclude>org.tukaani:xz</exclude>
                                            <exclude>org.xerial.snappy:snappy-java</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>
