<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>

	<artifactId>sansa-rdf-spark_2.11</artifactId>

	<parent>
		<groupId>net.sansa-stack</groupId>
		<artifactId>sansa-rdf-parent_2.11</artifactId>
		<version>0.4.0</version>
	</parent>

	<dependencies>

		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>sansa-rdf-common${scala.version.suffix}</artifactId>
			<!-- <classifier>${scala.classifier}</classifier> -->
		</dependency>

		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-core_${scala.binary.version}</artifactId>
		</dependency>

		<!-- Override jetty-util of spark-core -->
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-util</artifactId>
			<scope>test</scope>
		</dependency>


		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-sql_${scala.binary.version}</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-graphx_${scala.binary.version}</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-streaming_${scala.binary.version}</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-streaming-kafka-0-10_${scala.binary.version}</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-mllib_2.11</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>it.unimi.dsi</groupId>
			<artifactId>fastutil</artifactId>
			<version>8.1.0</version>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Scala -->
		<dependency>
			<groupId>org.scala-lang</groupId>
			<artifactId>scala-library</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>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-hive_${scala.binary.version}</artifactId>
			<scope>compile</scope>
		</dependency>

		<!-- JENA API -->

		<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.aksw.sparqlify</groupId>
			<artifactId>sparqlify-core</artifactId>
		</dependency>

		<!-- <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> 
			</dependency> -->
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-mapreduce-client-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-common</artifactId>
		</dependency>

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

		<dependency>
			<groupId>de.javakaffee</groupId>
			<artifactId>kryo-serializers</artifactId>
		</dependency>

		<dependency>
			<groupId>com.typesafe</groupId>
			<artifactId>config</artifactId>
		</dependency>

		<!-- Spark-Bench -->
		<dependency>
			<groupId>com.ibm.sparktc.sparkbench</groupId>
			<artifactId>sparkbench</artifactId>
			<!--<scope>test</scope>-->
		</dependency>

	</dependencies>

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

	<profiles>
	<profile>
		<id>dist</id>
		<activation>
			<property>
				<name>dist</name>
			</property>
		</activation>
		<!-- This profile uses the assembly plugin to create a special "dist" package for BigTop
             that contains Spark but not the Hadoop JARs it depends on. -->
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<!--<version>3.1.1</version>-->
					<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>
										<exclude>org.glassfish.hk2*</exclude>
										<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>
										<exclude>org.apache.poi:*</exclude>
										<exclude>org.apache.batik:*</exclude>
										<exclude>com.ibm.sparktc:*</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>
									<filter>
										<artifact>net.sansa-stack:*</artifact>
										<includes>
											<include>**</include>
										</includes>
									</filter>
									<!-- This has to be done because the service transformer finds InitJenaSparqlApiSparqlExtensions
									     in adds it to the Jena subsystem lifecycle,
									     but the class itself is removed during minimization, the Jena init procedure fails
									-->
									<filter>
										<artifact>org.aksw.jena-sparql-api:jena-sparql-api-sparql-ext</artifact>
										<includes>
											<include>org/aksw/jena_sparql_api/sparql/ext/init/*</include>
										</includes>
									</filter>
								</filters>
								<finalName>dist-${project.artifactId}-${project.version}</finalName>
								<transformers>
									<transformer
											implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
								</transformers>
								<createDependencyReducedPom>false</createDependencyReducedPom>

							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>
	</profiles>

	<!-- <build> <sourceDirectory>src/main/scala</sourceDirectory> <testSourceDirectory>src/test/scala</testSourceDirectory> 
		<plugins> <plugin> <groupId>net.alchim31.maven</groupId> <artifactId>scala-maven-plugin</artifactId> 
		<executions> <execution> <goals> <goal>add-source</goal> <goal>compile</goal> 
		<goal>testCompile</goal> </goals> </execution> </executions> </plugin> </plugins> 
		</build> -->
</project>
