<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>net.sansa-stack</groupId>
        <artifactId>sansa-inference-parent_2.11</artifactId>
        <version>0.3.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <groupId>net.sansa-stack</groupId>
    <artifactId>sansa-inference-spark_${scala.binary.version}</artifactId>
    <version>0.3.0</version>

    <name>Inference API - Spark</name>
    <description>Apache Spark based inference layer for RDF and OWL</description>

    <properties>
        <spark.deps.scope>compile</spark.deps.scope>
    </properties>

    <dependencies>
        <dependency>
            <groupId>net.sansa-stack</groupId>
            <artifactId>sansa-inference-common_${scala.binary.version}</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sansa-stack</groupId>
            <artifactId>sansa-inference-tests_${scala.binary.version}</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <!-- RDF Layer -->
        <!--<dependency>-->
            <!--<groupId>${project.groupId}</groupId>-->
            <!--<artifactId>sansa-rdf-spark-core</artifactId>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>net.sansa-stack</groupId>-->
            <!--<artifactId>sansa-rdf-partition-core</artifactId>-->
        <!--</dependency>-->

        <!-- Query Layer -->
        <!--<dependency>-->
            <!--<groupId>net.sansa-stack</groupId>-->
            <!--<artifactId>sansa-query-spark-sparqlify</artifactId>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>org.aksw.jena-sparql-api</groupId>-->
            <!--<artifactId>jena-sparql-api-server-standalone</artifactId>-->
        <!--</dependency>-->

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

        <!-- Apache Spark Core -->
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.binary.version}</artifactId>
            <scope>${spark.deps.scope}</scope>
        </dependency>
        <!-- Apache Spark SQL -->
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.binary.version}</artifactId>
            <scope>${spark.deps.scope}</scope>
        </dependency>

        <!-- Shapeless lib -->
        <dependency>
            <groupId>com.chuusai</groupId>
            <artifactId>shapeless_${scala.binary.version}</artifactId>
        </dependency>

        <!-- Apache JENA 3.x-->
        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-arq</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-tdb</artifactId>
            <version>${jena.version}</version>
        </dependency>

        <!-- OWL API -->
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-api</artifactId>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-apibinding</artifactId>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-parsers</artifactId>
        </dependency>

        <!-- Graph API -->
        <dependency>
            <groupId>com.assembla.scala-incubator</groupId>
            <artifactId>graph-core_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>com.assembla.scala-incubator</groupId>
            <artifactId>graph-dot_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jgrapht</groupId>
            <artifactId>jgrapht-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jgrapht</groupId>
            <artifactId>jgrapht-ext</artifactId>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>gephi-toolkit</artifactId>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.binary.version}</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.holdenkarau</groupId>
            <artifactId>spark-testing-base_${scala.binary.version}</artifactId>
            <!--version>${spark.version}_0.7.1</version-->
            <version>2.2.0_0.8.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-hive_${scala.binary.version}</artifactId>
            <version>${spark.version}</version>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>org.specs2</groupId>
            <artifactId>specs2-core_${scala.binary.version}</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.specs2</groupId>
            <artifactId>specs2-junit_${scala.binary.version}</artifactId>
            <scope>test</scope>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.groupon.dse</groupId>-->
            <!--<artifactId>spark-metrics</artifactId>-->
            <!--<version>2.0.1-SNAPSHOT</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->

        <!-- Logging -->
        <dependency>
            <groupId>com.typesafe.scala-logging</groupId>
            <artifactId>scala-logging_${scala.binary.version}</artifactId>
        </dependency>

        <!-- Scopt -->
        <dependency>
            <groupId>com.github.scopt</groupId>
            <artifactId>scopt_${scala.binary.version}</artifactId>
        </dependency>

        <!-- Config API -->
        <dependency>
            <groupId>com.typesafe</groupId>
            <artifactId>config</artifactId>
        </dependency>

    </dependencies>

    <build>
        <sourceDirectory>src/main/scala</sourceDirectory>
        <testSourceDirectory>src/test/scala</testSourceDirectory>
        <!--<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>-->
        <!--<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>-->
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
            </plugin>

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

            <!-- disable surefire -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <useFile>false</useFile>
                    <disableXmlReport>true</disableXmlReport>
                    <!--<forkCount>1</forkCount>-->
                    <!--<reuseForks>false</reuseForks>-->

                    <!-- If you have classpath issue like NoDefClassError,... -->
                    <!-- useManifestOnlyJar>false</useManifestOnlyJar -->
                    <threadCountSuites>4</threadCountSuites>
                    <includes>
                        <include>**/*Test.*</include>
                        <include>**/*Suite.*</include>
                    </includes>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>

            <!-- enable scalatest -->
            <plugin>
              <groupId>org.scalatest</groupId>
              <artifactId>scalatest-maven-plugin</artifactId>
              <configuration>
                <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                <junitxml>.</junitxml>
                <filereports>SANSA-TestSuite.txt</filereports>
              </configuration>
              <executions>
                <execution>
                  <id>test</id>
                  <goals>
                    <goal>test</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <!-- Add src/main/scala to eclipse build path -->
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/scala</source>
                            </sources>
                        </configuration>
                    </execution>
                    <!-- Add src/test/scala to eclipse build path -->
                    <execution>
                        <id>add-test-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/scala</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--Extract core's resources-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <!--<version>3.0.1</version>-->
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>package</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeGroupIds>${project.groupId}</includeGroupIds>
                            <includeArtifactIds>sansa-inference-tests_${scala.binary.version}</includeArtifactIds>
                            <excludeTransitive>true</excludeTransitive>
                            <overWriteIfNewer>true</overWriteIfNewer>
                            <outputDirectory>${project.build.directory}/core-resources</outputDirectory>
                            <excludes>org/**,META-INF/**,rebel.xml</excludes>
                            <overWriteReleases>true</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <!--New resource locations-->
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>${project.build.directory}/core-resources</directory>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
        </resources>
    </build>

    <profiles>
        <!-- This profile uses the Maven shade plugin to create a special "dist" package
                that does not contain Spark etc. -->
        <profile>
            <id>dist</id>
            <activation>
                <property>
                    <name>dist</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <!--<plugin>-->
                        <!--<groupId>org.apache.maven.plugins</groupId>-->
                        <!--<artifactId>maven-assembly-plugin</artifactId>-->
                        <!--<version>3.0.0</version>-->
                        <!--<executions>-->
                            <!--<execution>-->
                                <!--<id>dist</id>-->
                                <!--<phase>package</phase>-->
                                <!--<goals>-->
                                    <!--<goal>single</goal>-->
                                <!--</goals>-->
                                <!--<configuration>-->
                                    <!--&lt;!&ndash;<descriptorRefs>&ndash;&gt;-->
                                        <!--&lt;!&ndash;<descriptorRef>jar-with-dependencies</descriptorRef>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</descriptorRefs>&ndash;&gt;-->
                                    <!--<descriptors>-->
                                        <!--<descriptor>src/main/assembly/assembly.xml</descriptor>-->
                                    <!--</descriptors>-->
                                <!--</configuration>-->
                            <!--</execution>-->
                        <!--</executions>-->
                    <!--</plugin>-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <minimizeJar>true</minimizeJar>
                                    <artifactSet>
                                        <excludes>
                                            <exclude>org.apache.spark:spark-core_${scala.binary.version}</exclude>
                                            <exclude>org.apache.spark:spark-sql_${scala.binary.version}</exclude>
                                            <exclude>org.apache.spark:spark-graphx_${scala.binary.version}</exclude>
                                            <exclude>org.apache.spark:*</exclude>
                                            <exclude>org.eclipse.jetty:jetty-server</exclude>
                                            <exclude>org.eclipse.jetty:jetty-continuation</exclude>
                                            <exclude>org.eclipse.jetty:jetty-http</exclude>
                                            <exclude>org.eclipse.jetty:jetty-io</exclude>
                                            <exclude>org.eclipse.jetty:jetty-util</exclude>
                                            <exclude>org.eclipse.jetty:jetty-security</exclude>
                                            <exclude>org.eclipse.jetty:jetty-servlet</exclude>
                                            <exclude>org.eclipse.jetty:*</exclude>
                                            <exclude>org.eclipse.*:*</exclude>
                                            <exclude>org.glassfish.*:*</exclude>
                                            <exclude>org.netbeans.api:*</exclude>
                                            <exclude>org.netbeans:*</exclude>
                                            <exclude>org.scala-lang:scala-library</exclude>
                                            <exclude>org.scala-lang:scala-compiler</exclude>
                                            <exclude>org.scala-lang:scala-reflect</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-digester:commons-digester</exclude>
                                            <exclude>commons-httpclient:commons-httpclient</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>io.dropwizard.metrics:metrics*</exclude>
                                            <exclude>io.netty:netty*</exclude>
                                            <exclude>javax.activation:activation</exclude>
                                            <exclude>javax.annotation:javax.annotation-api</exclude>
                                            <exclude>javax.servlet:javax.servlet-api</exclude>
                                            <exclude>javax.servlet.jsp:jsp-api</exclude>
                                            <exclude>javax.servlet:servlet-api</exclude>
                                            <exclude>javax.validation:validation-api</exclude>
                                            <exclude>javax.ws.rs:javax.ws.rs-api</exclude>
                                            <exclude>javax.xml.bind:jaxb-api</exclude>
                                            <exclude>javax.xml.stream:stax-api</exclude>
                                            <exclude>jdk.tools:jdk.tools</exclude>
                                            <exclude>net.java.dev.jets3t:jets3t</exclude>
                                            <exclude>net.jpountz.lz4:lz4</exclude>
                                            <exclude>net.razorvine:pyrolite</exclude>
                                            <exclude>net.sf.py4j:py4j</exclude>
                                            <exclude>org.antlr:antlr4-runtime</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.curator:curator*</exclude>
                                            <exclude>org.apache.directory.api:*</exclude>
                                            <exclude>org.apache.directory.server:*</exclude>
                                            <exclude>org.apache.hadoop:*</exclude>
                                            <exclude>org.apache.htrace:htrace-core</exclude>
                                            <exclude>org.apache.httpcomponents:*</exclude>
                                            <exclude>org.apache.ivy:ivy</exclude>
                                            <exclude>org.apache.mesos:mesos</exclude>
                                            <exclude>org.apache.parquet:parquet*</exclude>
                                            <exclude>org.apache.xbean:xbean-asm5-shaded</exclude>
                                            <exclude>org.apache.zookeeper:zookeeper</exclude>
                                            <exclude>org.codehaus.jackson:jackson-*</exclude>
                                            <exclude>org.codehaus.janino:*</exclude>
                                            <exclude>org.codehaus.jettison:jettison</exclude>
                                            <exclude>org.fusesource.leveldbjni:leveldbjni-all</exclude>
                                            <exckude>org.glassfish.hk2*</exckude>
                                            <exclude>org.glassfish.jersey*</exclude>
                                            <exclude>org.javassist:javassist</exclude>
                                            <exclude>org.json4s:json4s*</exclude>
                                            <exclude>org.mortbay.jetty:jetty*</exclude>
                                            <exclude>org.objenesis:objenesis</exclude>
                                            <exclude>org.roaringbitmap:RoaringBitmap</exclude>
                                            <exclude>org.scala-lang:*</exclude>
                                            <exclude>org.slf4j:jul-to-slf4j</exclude>
                                            <exclude>org.slf4j:jcl-over-slf4j</exclude>
                                            <exclude>org.spark-project.spark:unused</exclude>
                                            <exclude>org.xerial.snappy:snappy-java</exclude>
                                            <exclude>oro:oro</exclude>
                                            <exclude>xmlenc:xmlenc</exclude>
                                            <exclude>org.gephi:*</exclude>
                                            <exclude>org.jfree:*</exclude>
                                            <exclude>com.itextpdf:*</exclude>
                                        </excludes>

                                    </artifactSet>
                                    <filters>
                                        <filter>
                                            <artifact>*:*</artifact>
                                            <excludes>
                                                <!-- Avoid a Spark error: Invalid signature file digest for Manifest main attributes-->
                                                <exclude>META-INF/*.SF</exclude>
                                                <exclude>META-INF/*.DSA</exclude>
                                                <exclude>META-INF/*.RSA</exclude>
                                                <exclude>META-INF/maven/**</exclude>
                                            </excludes>
                                        </filter>
                                        <filter>
                                            <artifact>org.apache.jena:*</artifact>
                                            <includes>
                                                <include>**</include>
                                            </includes>
                                        </filter>
                                    </filters>
                                    <finalName>dist-${project.artifactId}-${project.version}</finalName>
                                    <transformers>
                                        <transformer
                                                implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                            <mainClass>net.sansa_stack.inference.spark.RDFGraphMaterializer</mainClass>
                                        </transformer>
                                    </transformers>
                                    <createDependencyReducedPom>false</createDependencyReducedPom>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Profile that disables inclusion of Spark dependencies. -->
        <profile>
            <id>spark-provided</id>
            <activation>
                <property>
                    <name>dist</name>
                </property>
            </activation>
            <properties>
                <spark.deps.scope>provided</spark.deps.scope>
            </properties>
        </profile>

        <profile>
            <id>dist-package</id>
            <build>
                <finalName>SANSA-Inference-Spark-${project.version}</finalName>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <!-- here the phase you need -->
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${basedir}/target/scripts</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>scripts</directory>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>prepare-package</phase>
                                <configuration>
                                    <tasks>
                                        <replace token="VERSION_TMP" value="dist-${project.artifactId}-${project.version}.jar" dir="target/scripts">
                                            <include name="cli"/>
                                        </replace>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <!--<minimizeJar>true</minimizeJar>-->
                                    <artifactSet>
                                        <excludes>
                                            <exclude>org.apache.spark:spark-core_${scala.binary.version}</exclude>
                                            <exclude>org.apache.spark:spark-sql_${scala.binary.version}</exclude>
                                            <exclude>org.apache.spark:spark-graphx_${scala.binary.version}</exclude>
                                            <exclude>org.apache.spark:*</exclude>
                                            <exclude>org.eclipse.jetty:jetty-server</exclude>
                                            <exclude>org.eclipse.jetty:jetty-continuation</exclude>
                                            <exclude>org.eclipse.jetty:jetty-http</exclude>
                                            <exclude>org.eclipse.jetty:jetty-io</exclude>
                                            <exclude>org.eclipse.jetty:jetty-util</exclude>
                                            <exclude>org.eclipse.jetty:jetty-security</exclude>
                                            <exclude>org.eclipse.jetty:jetty-servlet</exclude>
                                            <exclude>org.eclipse.jetty:*</exclude>
                                            <exclude>org.eclipse.*:*</exclude>
                                            <exclude>org.glassfish.*:*</exclude>
                                            <exclude>org.netbeans.api:*</exclude>
                                            <exclude>org.scala-lang:scala-library</exclude>
                                            <exclude>org.scala-lang:scala-compiler</exclude>
                                            <exclude>org.scala-lang:scala-reflect</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-digester:commons-digester</exclude>
                                            <exclude>commons-httpclient:commons-httpclient</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>io.dropwizard.metrics:metrics*</exclude>
                                            <exckude>io.netty:netty*</exckude>
                                            <exclude>javax.activation:activation</exclude>
                                            <exclude>javax.annotation:javax.annotation-api</exclude>
                                            <exclude>javax.servlet:javax.servlet-api</exclude>
                                            <exclude>javax.servlet.jsp:jsp-api</exclude>
                                            <exclude>javax.servlet:servlet-api</exclude>
                                            <exclude>javax.validation:validation-api</exclude>
                                            <exclude>javax.ws.rs:javax.ws.rs-api</exclude>
                                            <exclude>javax.xml.bind:jaxb-api</exclude>
                                            <exclude>javax.xml.stream:stax-api</exclude>
                                            <exclude>jdk.tools:jdk.tools</exclude>
                                            <exclude>net.java.dev.jets3t:jets3t</exclude>
                                            <exclude>net.jpountz.lz4:lz4</exclude>
                                            <exclude>net.razorvine:pyrolite</exclude>
                                            <exclude>net.sf.py4j:py4j</exclude>
                                            <exclude>org.antlr:antlr4-runtime</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.curator:curator*</exclude>
                                            <exclude>org.apache.directory.api:*</exclude>
                                            <exclude>org.apache.directory.server:*</exclude>
                                            <exclude>org.apache.hadoop:*</exclude>
                                            <exclude>org.apache.htrace:htrace-core</exclude>
                                            <exclude>org.apache.httpcomponents:*</exclude>
                                            <exclude>org.apache.ivy:ivy</exclude>
                                            <exclude>org.apache.mesos:mesos</exclude>
                                            <exclude>org.apache.parquet:parquet*</exclude>
                                            <exclude>org.apache.xbean:xbean-asm5-shaded</exclude>
                                            <exclude>org.apache.zookeeper:zookeeper</exclude>
                                            <exclude>org.codehaus.jackson:jackson-*</exclude>
                                            <exclude>org.codehaus.janino:*</exclude>
                                            <exclude>org.codehaus.jettison:jettison</exclude>
                                            <exclude>org.fusesource.leveldbjni:leveldbjni-all</exclude>
                                            <exckude>org.glassfish.hk2*</exckude>
                                            <exclude>org.glassfish.jersey*</exclude>
                                            <exclude>org.javassist:javassist</exclude>
                                            <exclude>org.json4s:json4s*</exclude>
                                            <exclude>org.mortbay.jetty:jetty*</exclude>
                                            <exclude>org.objenesis:objenesis</exclude>
                                            <exclude>org.roaringbitmap:RoaringBitmap</exclude>
                                            <exclude>org.scala-lang:*</exclude>
                                            <exclude>org.slf4j:jul-to-slf4j</exclude>
                                            <exclude>org.slf4j:jcl-over-slf4j</exclude>
                                            <exclude>org.spark-project.spark:unused</exclude>
                                            <exclude>org.xerial.snappy:snappy-java</exclude>
                                            <exclude>oro:oro</exclude>
                                            <exclude>xmlenc:xmlenc</exclude>
                                            <exclude>org.gephi:*</exclude>
                                            <exclude>org.jfree:*</exclude>
                                            <exclude>com.itextpdf:*</exclude>
                                        </excludes>

                                    </artifactSet>
                                    <filters>
                                        <filter>
                                            <artifact>*:*</artifact>
                                            <excludes>
                                                <!-- Avoid a Spark error: Invalid signature file digest for Manifest main attributes-->
                                                <exclude>META-INF/*.SF</exclude>
                                                <exclude>META-INF/*.DSA</exclude>
                                                <exclude>META-INF/*.RSA</exclude>
                                                <exclude>META-INF/maven/**</exclude>
                                            </excludes>
                                        </filter>
                                        <filter>
                                            <artifact>org.apache.jena:*</artifact>
                                            <includes>
                                                <include>**</include>
                                            </includes>
                                        </filter>
                                    </filters>
                                    <finalName>dist-${project.artifactId}-${project.version}</finalName>
                                    <outputDirectory>${project.build.directory}/shaded</outputDirectory>
                                    <transformers>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                            <mainClass>net.sansa_stack.inference.spark.RDFGraphMaterializer</mainClass>
                                        </transformer>
                                    </transformers>
                                    <createDependencyReducedPom>false</createDependencyReducedPom>
                                    <!--<shadedArtifactAttached>true</shadedArtifactAttached>-->
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/assembly-bin.xml</descriptor>
                            </descriptors>
                            <appendAssemblyId>false</appendAssemblyId>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id> <!-- this is used for inheritance merges -->
                                <phase>package</phase> <!-- bind to the packaging phase -->
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>
